How to control device context in two ways |
MZIskandar
|
Hello.
You can use SDL_SetRenderTarget to draw/prepare everything first on a texture. eg: 1. Rendering a sentence "Hello World" 2. Use SDL_SetRenderTarget to draw each character on a texture. 3. Use SDL_RenderCopy to "present" it many times/game loop without recreating the sentence. 4. SDL_RenderPresent to draw everything. |
|||||||||||
|
梦影幻忆
|
Thanks~~
but...... not in English. Only 26 letters in English. I use Chinese characters, cannot allocate all temporary render texture. Demo: 1.Read *.txt file. 2.Set sdl_ttf sdk (set read *.ttf file) 3.Chinese characters to SDL_Surface. 4.SDL_Surface to SDL_Texture. 5.Render image texture and font texture. I have done this before. but now i want cancel the step 4. |
|||||||||||
|