Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TLN_SetRenderTarget parameter
#2
Yeah, this one should be normalized... in C, a void* pointer means "anything goes" (an opaque type thing), but in C++ it must be explicitly cast or an error is thrown.

The actual internal format of the framebuffer is 32-bit RGBA pixels, but you can ambiguously express it as 8-bit channel values, as it's just a countiguous chunk of memory. Parameter type should express the kind of data, but there's no standard way to express 32-bit RGBA. And the "anything goes" void* isn't true either... That's why I used uint8_t*, to state that there are just bytes.

What do you think that makes more sense?

----------

The exact place in Window.c with the framebuffer/SDL texture link is here:
https://github.com/megamarc/Tilengine/bl...dow.c#L978
  • The TLN_BeginWindowFrame() function locks the SDL_Texture backbuffer, acquiring direct acces to pixel data, and feeds Tilengine with this data in the next line.
https://github.com/megamarc/Tilengine/bl...ow.c#L1030
  • Once the frame is finished, the TLN_EndWindowFrame() function unlocks the backbuffer object, that has just get the framebuffer rendered. Now it's ready to be blitted to the window with regular SDL function calls.
Reply


Messages In This Thread
TLN_SetRenderTarget parameter - by Domarius - 07-18-2018, 01:56 AM
RE: TLN_SetRenderTarget parameter - by megamarc - 07-18-2018, 03:15 AM
RE: TLN_SetRenderTarget parameter - by Domarius - 07-18-2018, 10:27 AM
RE: TLN_SetRenderTarget parameter - by megamarc - 07-18-2018, 03:33 PM
RE: TLN_SetRenderTarget parameter - by Domarius - 07-18-2018, 08:11 PM
RE: TLN_SetRenderTarget parameter - by megamarc - 07-19-2018, 03:44 PM
RE: TLN_SetRenderTarget parameter - by Domarius - 07-19-2018, 09:25 PM
RE: TLN_SetRenderTarget parameter - by megamarc - 07-21-2018, 03:56 PM
RE: TLN_SetRenderTarget parameter - by Domarius - 07-22-2018, 12:21 AM
RE: TLN_SetRenderTarget parameter - by megamarc - 07-24-2018, 01:52 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)