Created
November 25, 2016 22:33
-
-
Save kdridi/ca5da84a8d66b34f322cda9bb0cb0a57 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BYTES_PER_PIXEL 4 | |
typedef struct s_my_framebuffer | |
{ | |
unsigned int width; | |
unsigned int height; | |
sfUint8 pixels[1]; | |
} t_my_framebuffer; | |
t_my_framebuffer* my_framebuffer_create(unsigned int width, unsigned int height) | |
{ | |
t_my_framebuffer* b; | |
int bytePerPixels; | |
b = (t_my_framebuffer*) malloc(sizeof(t_my_framebuffer) + (width * height * BYTES_PER_PIXEL - 1) * sizeof(sfUint8)); | |
if (b != NULL) | |
{ | |
b->width = width; | |
b->height = height; | |
} | |
return b; | |
} | |
void my_framebuffer_create(t_my_framebuffer* b) | |
{ | |
free(b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment