Write by nine days Yan Ling (jtianling) -- blog.csdn.net/vagrxie
Discuss newsgroups and documents
Same paragraphProgramIn SDL with OpenGL, it is correct when glfw is used and Windows API is used to add OpenGL.As follows:Glbegin (gl_quads );Gltexcoord2f (0.0, 0.0); glvertex3f (-1.0,-1.0, 0.0 );Gltexcoord2f (1.0, 0.0); glvertex3f (1.0,-1.0, 0.0 );Gltexcoord2f (1.0, 1.0); glvertex3f (1.0, 1.0, 0.0 );Gltexcoord2f (0.0, 1.0); glvertex3f (-1.0, 1.0, 0.0
Lesson01.cpp
Copy Code code as follows:
/*this source code copyrighted by Lazy Foo ' Productions (2004-2013)
And May is redistributed without written permission.*/
Include SDL functions and datatypes#include "sdl/sdl.h"
int main (int argc, char* args[]){The imagessdl_surface* Hello = NULL;sdl_surface* screen = NULL;
Start SDLSdl_init (sdl_init_everything);
Set up screenScreen = Sdl_s
In the "SDL point, line, plane, and image loading" article, you are using SDL to display JPEG failures, and now you have a solution.Key functions:Sdl_rwops.h:
extern DECLSPEC Sdl_rwops * sdlcall sdl_rwfromfile (const char *file, const char *mode);
extern DECLSPEC void Sdlcall sdl_freerw (sdl_rwops *area);
Sdl_image.h:
extern DECLSPEC Sdl_surface * sdlcall img_loadjpg_rw (sdl_rwops *src);
View the img_jpg
The question in the online by many netizens questions, you have given a variety of answers. I have also encountered this problem in the SDL multimedia library. After a good burst of exploration, we finally found the answer.
Under normal circumstances, after compiling the SDL header files and libraries, simply point the header file to the correct location with the library file path. Then add the header files
is an example of the SDL Code implementation drewdemo.zip (Ubuntu 12.04LTS compiled, win users need to add the library Libmingw32 when connected). The following is the time the program runs. The program runs for a period of time (that is, the time to draw Sdl_texture) is 18ms on the E3 v1230+hd6770 pc. Bresenham is really a fast algorithm, especially on a single-chip microcomputer (MPU) with no hardware multiplication (multiplied by a number of 2 as
When qemu/KVM is started in full-screen mode, the "cocould not open SDL display" error is reported, and then the KVM Virtual Machine exits.
The reason is that the resolution of the KVM virtual machine is relatively high. High resolution refers to: (> = 1280x1024x16)
The solution is to add the following parameters when starting KVM:
Qemu/lkvm startup options:
'-VGAType'
'
STD'
Standard VGA Card with bochs VBE extensions. if your g
Digital oscilloscope GUI base on SDL.
1. soure code:
/* Bring up a window and play with it */
2. Run on x86:
3. How to Use SDL APIs:
1). sdl_init (sdl_init_video ).
Initialize the video devices such as framebuffer, direactfb, X11 or OpenGL etc.
2). Set the video device.
Sdl_surface * screen, * window;
Screen = sdl_setvideomode (W, H, 32, sdl_swsurface );
3). Draw some graphic data on the backbuffe
Use the FFMPEG library for video encoding and decoding, and Use SDL to play videos. For more information about the code, see the code of dranger.
extern "C" {#include "libavformat/avformat.h" #include "libswscale/swscale.h" }#include
Download here: http://www.ferzkopp.net/joomla/content/view/19/14/
The name is SDL_gfx, and here is its API document http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/index.html
Of course, if you only need scaling, you can also write a simple function to scale the image without other features. Here is
Complete scaling code is provided here:
Uint32 ReadPixel(SDL_Surface *surface, int x, int y){ int bpp = surface->format->BytesPerPixel; /* Here p is the address to the pixel we want to
These two days to do a video analysis software needs to use the SDL display images and text, the stage results are summarized:SDL itself does not have the functionality of the actual text, it needs to use its extension library Sdl_ttf:Http://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.htmlGossip less, see Code (Engineering Environment: VS2005):#include "stdafx.h" #pragma comment (lib, "SDL.lib") #pragma comment (lib, "Sdl2_image.lib") #pragma comment
Environment:
OS: Windows
IDE: V. S. 2008
FFmpeg: http://www.bairuitech.com/html/ruanjianxiazai/20080613/98.html
SDL:SDL-devel-1.2.15-VC.zip (Visual C ++) http://www.libsdl.org/download-1.2.php
Flowchart:
Source code file:
// Mytestall. cpp: defines the entry point of the console application. // # Include "stdafx. H "extern" C "{# include" libavformat/avformat. H "# include" libavcodec/avcodec. H "# include" libswscale/swscale. H "# include" SDL. H
1. Set the audio parameters and the corresponding callback function. When the sound device requires data, SDL automatically calls this callback function to fill the struct.
typedef struct SDL_AudioSpec {int freq;/**
2. Enable the sound Device
SDL_OpenAudio(wanted_spec, spec)
3. Start Playing
SDL_PauseAudio(0);
4. decode the audio stream in the callback function and copy the decoded buffer to the stream.
Void audio_callback (void * userdata, uint8
Games are primarily interactive games. What is the difference between games without interaction and movies...
So we have to deal with many related events, press or open the keyboard, move the mouse, and click ....
Events are used to drive the game. SDL provides convenient functions to process events in the program. Events are defined as the combined sdl_event for multiple events, the following function retrieves the first event in the event queue:
Int
Project Address:Https://github.com/jthmath/StringPlayerFrost String VideoThis is one of my open source projects. The goal is to become a sound and video player. But now only the function of playing audio is realized.The development environment is Windows 8.1 64-bit,vs2013 with Update4.The Open Source Library used: ffmpeg,sdl.Right-click on the window, a menu will pop up, select "Open File", then select an audio file to play.At present the function is also very primitive, has not realized the pau
In the previous chapter I briefly introduced our first SDL applet to implement a small palette function, focusing on how to draw your own patterns on sdl_surface,
In this chapter I focus on the sdl_surface of the text on the display of the analysis. Let our screen also have its own text tag ... Of course.. You can also make your own notepad ....
Of course.. Want to write, one of the necessary is to have a font, you can download nfs-share.tar.gz the
This article is practically the same as learning Notes 3 and 4, and the future requires in-depth understanding of the concepts of window, render, texture, surface, etc.
#include "SDL.h" struct {Uint32 pixformat;
int W, H;
Uint8
Movie files have a lot of basic components. First, the file itself is called a container container, and the type of the container determines where the information is stored in the file. Avi and QuickTime are examples of containers. Then you have a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.