Fixed Null backend
This commit is contained in:
parent
5596c33b38
commit
29f7c19a02
1 changed files with 12 additions and 4 deletions
|
@ -4,8 +4,9 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
static unsigned char *framebuffer;
|
static unsigned char *framebuffer;
|
||||||
|
static size_t framebuffer_pitch;
|
||||||
|
|
||||||
unsigned char* WindowBackend_Software_CreateWindow(const char *window_title, int screen_width, int screen_height, bool fullscreen, size_t *pitch)
|
bool WindowBackend_Software_CreateWindow(const char *window_title, int screen_width, int screen_height, bool fullscreen)
|
||||||
{
|
{
|
||||||
(void)window_title;
|
(void)window_title;
|
||||||
(void)fullscreen;
|
(void)fullscreen;
|
||||||
|
@ -14,12 +15,12 @@ unsigned char* WindowBackend_Software_CreateWindow(const char *window_title, int
|
||||||
|
|
||||||
if (framebuffer != NULL)
|
if (framebuffer != NULL)
|
||||||
{
|
{
|
||||||
*pitch = screen_width * 3;
|
framebuffer_pitch = screen_width * 3;
|
||||||
|
|
||||||
return framebuffer;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowBackend_Software_DestroyWindow(void)
|
void WindowBackend_Software_DestroyWindow(void)
|
||||||
|
@ -27,6 +28,13 @@ void WindowBackend_Software_DestroyWindow(void)
|
||||||
free(framebuffer);
|
free(framebuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned char* WindowBackend_Software_GetFramebuffer(size_t *pitch)
|
||||||
|
{
|
||||||
|
*pitch = framebuffer_pitch;
|
||||||
|
|
||||||
|
return framebuffer;
|
||||||
|
}
|
||||||
|
|
||||||
void WindowBackend_Software_Display(void)
|
void WindowBackend_Software_Display(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue