f***ed up and needed to rework packages
This commit is contained in:
parent
f4592ae8d0
commit
b43ab1702f
73 changed files with 194 additions and 2045 deletions
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef ARC_OPENGL_RENDERER_H_
|
||||
#define ARC_OPENGL_RENDERER_H_
|
||||
|
||||
#ifdef ARC_GLFW_WINDOW
|
||||
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "arc/graphics/renderer.h"
|
||||
#include "arc/graphics/window.h"
|
||||
|
||||
typedef struct ARC_RendererType {
|
||||
GLFWwindow *window;
|
||||
} ARC_RendererType;
|
||||
|
||||
/**
|
||||
* @brief struct for info needed to create glfw 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_WINDOW
|
||||
|
||||
#endif // !ARC_OPENGL_RENDERER_H_
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
#ifndef ARC_OPENGL_WINDOW_H_
|
||||
#define ARC_OPENGL_WINDOW_H_
|
||||
|
||||
#ifdef ARC_GLFW_WINDOW
|
||||
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
|
||||
#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_WINDOW
|
||||
|
||||
#endif // !ARC_GLFW_WINDOW_H_
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/renderer.h"
|
||||
//#include "arc/graphics/renderer.h"
|
||||
|
||||
#ifndef ARC_NONE_RENDERER_H_
|
||||
#define ARC_NONE_RENDERER_H_
|
||||
|
||||
typedef void ARC_RendererType;
|
||||
|
||||
struct ARC_RenderInfo {};
|
||||
//typedef void ARC_RendererType;
|
||||
|
||||
#endif // !ARC_NONE_RENDERER_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,10 @@
|
|||
#ifndef ARC_NONE_WINDOW_H_
|
||||
#define ARC_NONE_WINDOW_H_
|
||||
|
||||
#include "arc/graphics/window.h"
|
||||
//#include "arc/graphics/window.h"
|
||||
|
||||
typedef void ARC_WindowType;
|
||||
|
||||
struct ARC_WindowInfo {};
|
||||
//typedef void ARC_WindowType;
|
||||
|
||||
#endif // !ARC_SDL_WINDOW_H_
|
||||
|
||||
#endif // !ARC_NONE_WINDOW
|
||||
#endif // !ARC_NONE_WINDOW
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
#ifndef ARC_OPENGL_SPRITE_H_
|
||||
#define ARC_OPENGL_SPRITE_H_
|
||||
|
||||
#ifdef ARC_OPENGL_GRAPHICS
|
||||
|
||||
#include "arc/graphics/sprite.h"
|
||||
|
||||
struct ARC_Sprite {
|
||||
};
|
||||
|
||||
#endif // !ARC_OPENGL_GRAPHICS
|
||||
|
||||
#endif // !ARC_OPENGL_SPRITE_H_
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
#ifndef ARC_OPENGL_SPRITESHEET_H_
|
||||
#define ARC_OPENGL_SPRITESHEET_H_
|
||||
|
||||
#ifdef ARC_OPENGL_GRAPHICS
|
||||
|
||||
#include "arc/graphics/spritesheet.h"
|
||||
|
||||
struct ARC_Spritesheet {
|
||||
};
|
||||
|
||||
#endif // !ARC_OPENGL_GRAPHICS
|
||||
|
||||
#endif // !ARC_OPENGL_SPRITESHEET_H_
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#ifndef ARC_OPENGL_TEXT_H_
|
||||
#define ARC_OPENGL_TEXT_H_
|
||||
|
||||
#include "arc/std/string.h"
|
||||
#include "arc/graphics/color.h"
|
||||
#include "arc/math/rectangle.h"
|
||||
|
||||
#ifdef ARC_OPENGL_GRAPHICS
|
||||
|
||||
typedef struct ARC_Text {} ARC_Text;
|
||||
|
||||
#endif // !ARC_OPENGL_GRAPHICS
|
||||
|
||||
#endif // !ARC_OPENGL_TEXT_H_
|
||||
|
|
@ -5,23 +5,26 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief predefien ARC_EngineData so as not to get circular reference
|
||||
*/
|
||||
typedef struct ARC_EngineData ARC_EngineData;
|
||||
|
||||
/**
|
||||
* @note ARC_RendererType is determined by which window library you are using
|
||||
*/
|
||||
typedef struct ARC_RendererType ARC_Renderer;
|
||||
|
||||
typedef struct ARC_RenderInfo ARC_RenderInfo;
|
||||
|
||||
/**
|
||||
* @brief creates ARC_Renderer type
|
||||
* @brief creates ARC_Renderer type with ARC_EngineData
|
||||
*
|
||||
* @note the parameter data is determined by which graphics library you are using
|
||||
* please refer to the graphics library section to see what needs to be passed
|
||||
*
|
||||
* @param renderer ARC_Renderer to initialize
|
||||
* @param info Info on how to create ARC_Window
|
||||
* @param data the engine data to create from
|
||||
*/
|
||||
void ARC_Renderer_Create(ARC_Renderer **renderer, ARC_RenderInfo *info);
|
||||
void ARC_Renderer_CreateWithEngineData(ARC_Renderer **renderer, ARC_EngineData *data);
|
||||
|
||||
/**
|
||||
* @brief destroys ARC_Renderer type
|
||||
|
|
@ -30,8 +33,20 @@ void ARC_Renderer_Create(ARC_Renderer **renderer, ARC_RenderInfo *info);
|
|||
*/
|
||||
void ARC_Renderer_Destroy(ARC_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* @breif clears the renderer
|
||||
*
|
||||
* @param renderer the renderer to clear
|
||||
*/
|
||||
void ARC_Renderer_Clear(ARC_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* @brief renders the renderer
|
||||
*
|
||||
* @note the renderer will most likely be drawn to from ARC_EngineData
|
||||
*
|
||||
* @param renderer the renderer to render
|
||||
*/
|
||||
void ARC_Renderer_Render(ARC_Renderer *renderer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef ARC_SDL_RENDERER_H_
|
||||
#define ARC_SDL_RENDERER_H_
|
||||
|
||||
#ifdef ARC_SDL2_GRAPHICS
|
||||
#include "arc/graphics/renderer.h"
|
||||
#include "arc/graphics/window.h"
|
||||
#include <SDL.h>
|
||||
|
||||
typedef SDL_Renderer ARC_RendererType;
|
||||
|
||||
/**
|
||||
* @brief struct for info needed to create SDL_Renderer
|
||||
*
|
||||
* @note this is what needs to be passed into the data parameter for ARC_Renderer_Create
|
||||
*/
|
||||
|
||||
struct ARC_RenderInfo {
|
||||
SDL_Window *window;
|
||||
int index;
|
||||
Uint32 flags;
|
||||
};
|
||||
|
||||
#endif // !ARC_SDL2_GRAPHICS
|
||||
|
||||
#endif // !ARC_SDL_RENDERER_H_
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef ARC_SDL_SPRITE_H_
|
||||
#define ARC_SDL_SPRITE_H_
|
||||
|
||||
#ifdef ARC_SDL2_GRAPHICS
|
||||
#include "arc/graphics/sprite.h"
|
||||
#include <SDL.h>
|
||||
|
||||
struct ARC_Sprite {
|
||||
ARC_Spritesheet *spritesheet;
|
||||
ARC_Array *frames;
|
||||
uint32_t *frameIndex;
|
||||
//TODO: temp
|
||||
uint8_t opacity;
|
||||
};
|
||||
|
||||
#endif // !ARC_SDL2_GRAPHICS
|
||||
|
||||
#endif // !ARC_SDL_SPRITE_H_
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
#ifndef ARC_SDL_SPRITESHEET_H_
|
||||
#define ARC_SDL_SPRITESHEET_H_
|
||||
|
||||
#ifdef ARC_SDL2_GRAPHICS
|
||||
#include "arc/graphics/spritesheet.h"
|
||||
#include <SDL.h>
|
||||
|
||||
struct ARC_Spritesheet {
|
||||
SDL_Texture *texture;
|
||||
uint32_t *size;
|
||||
};
|
||||
|
||||
#endif // !ARC_SDL2_GRPAHCIS
|
||||
|
||||
#endif // !ARC_SDL_SPRITESHEET_H_
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef ARC_SDL_TEXT_H_
|
||||
#define ARC_SDL_TEXT_H_
|
||||
|
||||
#include "arc/std/string.h"
|
||||
#include "arc/graphics/color.h"
|
||||
#include "arc/math/rectangle.h"
|
||||
|
||||
#ifdef ARC_SDL2_GRAPHICS
|
||||
#include <SDL.h>
|
||||
|
||||
typedef struct ARC_Text {
|
||||
ARC_String *name;
|
||||
int32_t size;
|
||||
|
||||
ARC_Color color;
|
||||
|
||||
SDL_Texture *texture;
|
||||
ARC_Rect bounds;
|
||||
} ARC_Text;
|
||||
|
||||
#endif // !ARC_SDL2_Graphics
|
||||
|
||||
#endif // !ARC_SDL_TEXT_H_
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
#ifndef ARC_SDL_WINDOW_H_
|
||||
#define ARC_SDL_WINDOW_H_
|
||||
|
||||
#ifdef ARC_SDL2_GRAPHICS
|
||||
#include "arc/graphics/window.h"
|
||||
#include <SDL.h>
|
||||
|
||||
typedef SDL_Window ARC_WindowType;
|
||||
|
||||
/**
|
||||
* @brief struct for info needed to create SDL_Window
|
||||
*
|
||||
* @note this is what needs to be passed into the data parameter for ARC_Window_Create
|
||||
*/
|
||||
struct ARC_WindowInfo {
|
||||
char *title;
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
Uint32 flags;
|
||||
};
|
||||
|
||||
#endif // !ARC_SDL2_GRAPHICS
|
||||
|
||||
#endif // !ARC_SDL_WINDOW_H_
|
||||
|
|
@ -5,12 +5,21 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @note ARC_WindowType is determined by which window library you are using
|
||||
* @note ARC_WindowType is determined by which window backend you are using
|
||||
*/
|
||||
typedef struct ARC_WindowType ARC_Window;
|
||||
|
||||
typedef struct ARC_WindowInfo ARC_WindowInfo;
|
||||
/**
|
||||
* @note certain parts of ARC_WindowInfo may not be used by your selected backend
|
||||
*/
|
||||
typedef struct ARC_WindowInfo {
|
||||
char *title;
|
||||
int32_t w;
|
||||
int32_t h;
|
||||
} ARC_WindowInfo;
|
||||
|
||||
/**
|
||||
* @brief creates ARC_Window type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue