opengl added to engine
This commit is contained in:
parent
d8378484a7
commit
706a519452
31 changed files with 490 additions and 68 deletions
36
include/arc/graphics/opengl/renderer.h
Normal file
36
include/arc/graphics/opengl/renderer.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef ARC_OPENGL_RENDERER_H_
|
||||
#define ARC_OPENGL_RENDERER_H_
|
||||
|
||||
#ifdef ARC_OPENGL
|
||||
|
||||
#ifdef ARC_GLEW
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
#endif // !ARC_GLEW
|
||||
|
||||
#ifdef ARC_GLFW
|
||||
#include <GLFW/glfw3.h>
|
||||
#endif
|
||||
|
||||
#include "arc/graphics/renderer.h"
|
||||
#include "arc/graphics/window.h"
|
||||
|
||||
#ifdef ARC_GLFW
|
||||
typedef struct ARC_RendererType {
|
||||
GLFWwindow *window;
|
||||
} ARC_RendererType;
|
||||
|
||||
/**
|
||||
* @brief struct for info needed to create opengl renderer
|
||||
*
|
||||
* @note this is what needs to be passed into the data parameter for ARC_Renderer_Create
|
||||
*/
|
||||
struct ARC_RenderInfo {
|
||||
GLFWwindow *window;
|
||||
};
|
||||
|
||||
#endif // !ARC_GLFW
|
||||
|
||||
#endif // !ARC_OPENGL
|
||||
|
||||
#endif // !ARC_OPENGL_RENDERER_H_
|
||||
13
include/arc/graphics/opengl/sprite.h
Normal file
13
include/arc/graphics/opengl/sprite.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef ARC_OPENGL_SPRITE_H_
|
||||
#define ARC_OPENGL_SPRITE_H_
|
||||
|
||||
#ifdef ARC_OPENGL
|
||||
|
||||
#include "arc/graphics/sprite.h"
|
||||
|
||||
struct ARC_Sprite {
|
||||
};
|
||||
|
||||
#endif // !ARC_OPENGL
|
||||
|
||||
#endif // !ARC_OPENGL_SPRITE_H_
|
||||
13
include/arc/graphics/opengl/spritesheet.h
Normal file
13
include/arc/graphics/opengl/spritesheet.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef ARC_OPENGL_SPRITESHEET_H_
|
||||
#define ARC_OPENGL_SPRITESHEET_H_
|
||||
|
||||
#ifdef ARC_OPENGL
|
||||
|
||||
#include "arc/graphics/spritesheet.h"
|
||||
|
||||
struct ARC_Spritesheet {
|
||||
};
|
||||
|
||||
#endif // !ARC_OPENGL
|
||||
|
||||
#endif // !ARC_OPENGL_SPRITESHEET_H_
|
||||
29
include/arc/graphics/opengl/window.h
Normal file
29
include/arc/graphics/opengl/window.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef ARC_OPENGL_WINDOW_H_
|
||||
#define ARC_OPENGL_WINDOW_H_
|
||||
|
||||
#ifdef ARC_GLFW
|
||||
|
||||
#ifdef ARC_GLEW
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
#endif // !ARC_GLEW
|
||||
|
||||
#include "arc/graphics/window.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
typedef GLFWwindow ARC_WindowType;
|
||||
|
||||
/**
|
||||
* @brief struct for info needed to create a GLFWwindow
|
||||
*
|
||||
* @note this is what needs to be passed into the data parameter for ARC_Window_Create
|
||||
*/
|
||||
struct ARC_WindowInfo {
|
||||
char *title;
|
||||
int w;
|
||||
int h;
|
||||
};
|
||||
|
||||
#endif // !ARC_GLFW
|
||||
|
||||
#endif // !ARC_GLFW_WINDOW_H_
|
||||
|
|
@ -5,7 +5,10 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct ARC_Renderer ARC_Renderer;
|
||||
/**
|
||||
* @note ARC_RendererType is determined by which window library you are using
|
||||
*/
|
||||
typedef struct ARC_RendererType ARC_Renderer;
|
||||
|
||||
typedef struct ARC_RenderInfo ARC_RenderInfo;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,7 @@
|
|||
#include "arc/graphics/renderer.h"
|
||||
#include "arc/graphics/window.h"
|
||||
|
||||
// Temp till I figure out a better solution
|
||||
struct ARC_Renderer {
|
||||
SDL_Renderer *renderer;
|
||||
};
|
||||
typedef SDL_Renderer ARC_RendererType;
|
||||
|
||||
/**
|
||||
* @brief struct for info needed to create SDL_Renderer
|
||||
|
|
@ -24,6 +21,6 @@ struct ARC_RenderInfo {
|
|||
Uint32 flags;
|
||||
};
|
||||
|
||||
#endif // ARC_SDL
|
||||
#endif // !ARC_SDL
|
||||
|
||||
#endif // ARC_SDL_RENDERER_H_
|
||||
#endif // !ARC_SDL_RENDERER_H_
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ struct ARC_Sprite {
|
|||
uint32_t *frameIndex;
|
||||
};
|
||||
|
||||
#endif // ARC_SDL
|
||||
#endif // !ARC_SDL
|
||||
|
||||
#endif // ARC_SDL_SPRITE_H_
|
||||
#endif // !ARC_SDL_SPRITE_H_
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@ struct ARC_Spritesheet {
|
|||
uint32_t *size;
|
||||
};
|
||||
|
||||
#endif // ARC_SDL
|
||||
#endif // !ARC_SDL
|
||||
|
||||
#endif // ARC_SDL_SPRITESHEET_H_
|
||||
#endif // !ARC_SDL_SPRITESHEET_H_
|
||||
|
|
|
|||
|
|
@ -6,10 +6,7 @@
|
|||
#include <SDL.h>
|
||||
#include "arc/graphics/window.h"
|
||||
|
||||
// Temp till I figure out a better solution
|
||||
struct ARC_Window {
|
||||
SDL_Window *window;
|
||||
};
|
||||
typedef SDL_Window ARC_WindowType;
|
||||
|
||||
/**
|
||||
* @brief struct for info needed to create SDL_Window
|
||||
|
|
@ -25,6 +22,6 @@ struct ARC_WindowInfo {
|
|||
Uint32 flags;
|
||||
};
|
||||
|
||||
#endif // ARC_SDL
|
||||
#endif // !ARC_SDL
|
||||
|
||||
#endif // ARC_SDL_WINDOW_H_
|
||||
#endif // !ARC_SDL_WINDOW_H_
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct ARC_Window ARC_Window;
|
||||
/**
|
||||
* @note ARC_WindowType is determined by which window library you are using
|
||||
*/
|
||||
typedef struct ARC_WindowType ARC_Window;
|
||||
|
||||
typedef struct ARC_WindowInfo ARC_WindowInfo;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue