basic sdl init graphics and engine implementaiton
This commit is contained in:
parent
db1adbb838
commit
685364929b
18 changed files with 257 additions and 7 deletions
28
src/graphics/sdl/window.c
Normal file
28
src/graphics/sdl/window.c
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifdef ARC_SDL
|
||||
#include "arc/graphics/window.h"
|
||||
#include "arc/std/errno.h"
|
||||
|
||||
typedef SDL_Window ARC_Window;
|
||||
|
||||
void ARC_Window_Create(ARC_Window **window, void *data){
|
||||
if(!data){
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_ERR(arc_errno, "ARC_Window_Create(**window, NULL)");
|
||||
return;
|
||||
}
|
||||
|
||||
ARC_WindowInfo *info = (ARC_WindowInfo *)data;
|
||||
|
||||
*window = SDL_CreateWindow((const char *)info->title, info->x, info->y, info->w, info->h, info->flags);
|
||||
|
||||
if(!window){
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_LOG(arc_errno, "SDL_CreateWindow(%s, %d, %d, %d, %d, %x);", info->title, info->x, info->y, info->w, info->h, info->flags);
|
||||
}
|
||||
}
|
||||
|
||||
void ARC_Window_Destroy(ARC_Window *window){
|
||||
SDL_DestroyWindow((SDL_Window *) window);
|
||||
}
|
||||
|
||||
#endif //ARC_SDL
|
||||
Loading…
Add table
Add a link
Reference in a new issue