Retour au sujet

Avatar de vanity vanity
Et un deuxième :

#include <SFML/Audio.h>
#include <SFML/Graphics.h>
#include <stdlib.h>

typedef struct framebuffer {

unsigned int width;
unsigned int height;
sfUint8 *pixels;

} framebuffer_t;

void my_draw_square(framebuffer_t *buffer, sfVector2u position, unsigned int size, sfColor color)
{

}

void my_put_pixel(framebuffer_t *buffer, unsigned int x, unsigned int y, sfColor color)
{

}

framebuffer_t *framebuffer_create(unsigned int width, unsigned int height)
{
framebuffer_t *framebuffer = malloc(sizeof(framebuffer_t));

framebuffer->width = width;
framebuffer->height = height;
framebuffer->pixels = malloc(sizeof(sfUint8) * (width * height * 4));
return (framebuffer);
}