Hi! Two issues here:
Let me know!
I can see now that the "frame" parameter may be redundant somewhere in the API... I'll check this out.
- You've commented out TLN_Init(). The error comes from there. You can wipe out all the framebuffer thing because you are providing one, but not the TLN_Init().
- It's also missing the blitting of the backbuffer texture to the renderer, once it is done with the SDL_RenderCopy() function
Code:
// first initialise SDL window, SDL_Renderer and SDL_Texture just as you do
// ...
TLN_Init(SCREEN_WIDTH,SCREEN_HEIGHT, 2, 80, 0);
// And this inside your main loop:
SDL_LockTexture (backbuffer, NULL, (void**)&rt_pixels, &rt_pitch);
TLN_SetRenderTarget (rt_pixels, rt_pitch);
TLN_BeginFrame (frame);
TLN_UpdateFrame (frame++);
SDL_UnlockTexture (backbuffer);
SDL_RenderCopy (renderer, backbuffer, NULL, &dstrect);
Let me know!
I can see now that the "frame" parameter may be redundant somewhere in the API... I'll check this out.