added some opengl files TODO: fix up using glew as optional
This commit is contained in:
parent
c614c679a9
commit
d170a64a41
24 changed files with 164 additions and 93 deletions
|
|
@ -22,14 +22,12 @@
|
|||
#include <SDL.h>
|
||||
#include <SDL_video.h>
|
||||
#include <SDL2/SDL_ttf.h>
|
||||
#elif ARC_OPENGL
|
||||
#include "arc/graphics/opengl/window.h"
|
||||
#include "arc/graphics/opengl/renderer.h"
|
||||
#ifdef ARC_GLFW
|
||||
#endif
|
||||
|
||||
#include "arc/graphics/glfw/window.h"
|
||||
#include "arc/graphics/glfw/renderer.h"
|
||||
#include "arc/input/glfw/mouse.h"
|
||||
#include "arc/input/glfw/keyboard.h"
|
||||
#endif // ARC_GLFW
|
||||
#endif
|
||||
|
||||
void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanfn, ARC_Point windowSize){
|
||||
*data = (ARC_EngineData *)malloc(sizeof(ARC_EngineData));
|
||||
|
|
@ -52,7 +50,7 @@ void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanf
|
|||
|
||||
#ifdef ARC_SDL
|
||||
windowInfo = (ARC_WindowInfo){ "title", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (*data)->windowSize.x, (*data)->windowSize.y, 0 };
|
||||
#elif ARC_GLFW
|
||||
#elif ARC_GLFW_WINDOW
|
||||
windowInfo = (ARC_WindowInfo){ "title", (*data)->windowSize.x, (*data)->windowSize.y };
|
||||
#endif // ARC_SDL
|
||||
|
||||
|
|
@ -64,7 +62,7 @@ void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanf
|
|||
|
||||
#ifdef ARC_SDL
|
||||
renderInfo = (ARC_RenderInfo){ (SDL_Window *)(*data)->window, -1, SDL_RENDERER_ACCELERATED };
|
||||
#elif ARC_GLFW
|
||||
#elif ARC_GLFW_WINDOW
|
||||
renderInfo = (ARC_RenderInfo){ (GLFWwindow *)(*data)->window };
|
||||
#endif // ARC_SDL
|
||||
|
||||
|
|
@ -122,7 +120,7 @@ void ARC_Engine_Run(ARC_EngineData *data){
|
|||
|
||||
SDL_PollEvent(data->mouse->event);
|
||||
if(event->type == SDL_QUIT){ data->running = 1; }
|
||||
#elif ARC_GLFW
|
||||
#elif ARC_GLFW_WINDOW
|
||||
glfwPollEvents();
|
||||
data->running = glfwWindowShouldClose((GLFWwindow *)data->window);
|
||||
#endif // ARC_SDL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue