sdl3 migrate now compiling, need to go through all the files and clean them up
This commit is contained in:
parent
df4390ddba
commit
1b2e2cb7f1
26 changed files with 1139 additions and 0 deletions
26
packages/graphics/sdl3/window.c
Normal file
26
packages/graphics/sdl3/window.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include "arc/graphics/window.h"
|
||||
|
||||
#include "window.h"
|
||||
#include "arc/std/errno.h"
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
void ARC_Window_Create(ARC_Window **window, ARC_WindowInfo *info){
|
||||
if(!info){
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_LOG_ERROR("ARC_Window_Create(**window, NULL)");
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
|
||||
|
||||
*window = (ARC_Window *)SDL_CreateWindow((const char *)info->title, info->w, info->h, 0);
|
||||
|
||||
if(window == NULL){
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_LOG_ERROR_WITH_VARIABLES("SDL_CreateWindow(%s, %d, %d, %x);", info->title, info->w, info->h, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void ARC_Window_Destroy(ARC_Window *window){
|
||||
SDL_DestroyWindow((SDL_Window *) window);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue