Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create a framebuffer for use of external rendering
#1
as title suggests, I was following the "External Rendering" guide on the documentation site, however, when following it in v 2.15.2 it doesn't seem to work, owing to the provided code snippet:

    const int hres = 400;
    const int vres = 240;
    const int pitch = hres * sizeof(uint32_t);
    void* framebuffer;

    /* init and set framebuffer */
    TLN_Init (hres, vres, 2, 80, 0);
    framebuffer = malloc (pitch * vres);
    TLN_SetRenderTarget (framebuffer, pitch);


However on my end (visual studio 2022), TLN_SetRenderTarget's first argument (framebuffer) expects a uint8_t, not a void*, and changing framebuffer to that datatype causes malloc to break, as malloc returns a void*.
so what is it you're actually meant to do?
Reply


Messages In This Thread
How to create a framebuffer for use of external rendering - by raziel - 03-01-2024, 12:54 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)