Support for different platforms. Platform_desktop_sdl.
This commit is contained in:
@@ -1,20 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
enum EventType {
|
||||
EVENT_WINDOW_SIZE,
|
||||
EVENT_WINDOW_MAXIMIZE,
|
||||
EVENT_WINDOW_ICONYFY,
|
||||
EVENT_WINDOW_FOCUS,
|
||||
EVENT_WINDOW_DROP,
|
||||
EVENT_KEY,
|
||||
EVENT_CHAR,
|
||||
EVENT_MOUSE_BUTTON,
|
||||
EVENT_MOUSE_CURSOR_POS,
|
||||
EVENT_MOUSE_SCROLL,
|
||||
EVENT_CURSOR_ENTER,
|
||||
EVENT_JOYSTICK
|
||||
};
|
||||
|
||||
enum BufferType {
|
||||
BUFFER_UNSIGNED_CHAR,
|
||||
BUFFER_UNSIGNED_SHORT,
|
||||
@@ -32,6 +17,13 @@ typedef struct {
|
||||
void *data;
|
||||
} Buffer;
|
||||
|
||||
/* Global assing functions. */
|
||||
void assignGlobalInt( int value, const char *name );
|
||||
void assignGlobalFloat( float value, const char *name );
|
||||
void assignGlobalDouble( double value, const char *name );
|
||||
void assignGlobalColor( Color color, const char *name );
|
||||
void assingGlobalFunction( const char *name, int ( *functionPtr )( lua_State* ) );
|
||||
|
||||
bool luaInit( int argn, const char **argc );
|
||||
int luaTraceback( lua_State *L );
|
||||
bool luaCallMain();
|
||||
|
||||
@@ -13,8 +13,13 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "glad.h"
|
||||
#include "glfw3.h"
|
||||
#include "glfw3native.h"
|
||||
|
||||
#ifdef PLATFORM_DESKTOP
|
||||
#include "glfw3.h"
|
||||
#include "glfw3native.h"
|
||||
#elif PLATFORM_DESKTOP_SDL
|
||||
#include <SDL.h>
|
||||
#endif
|
||||
|
||||
#ifdef SHARED
|
||||
#include <raylib.h>
|
||||
|
||||
16
include/platforms/core_desktop.h
Normal file
16
include/platforms/core_desktop.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
enum EventType {
|
||||
GLFW_WINDOW_SIZE_EVENT,
|
||||
GLFW_WINDOW_MAXIMIZE_EVENT,
|
||||
GLFW_WINDOW_ICONYFY_EVENT,
|
||||
GLFW_WINDOW_FOCUS_EVENT,
|
||||
GLFW_WINDOW_DROP_EVENT,
|
||||
GLFW_KEY_EVENT,
|
||||
GLFW_CHAR_EVENT,
|
||||
GLFW_MOUSE_BUTTON_EVENT,
|
||||
GLFW_MOUSE_CURSOR_POS_EVENT,
|
||||
GLFW_MOUSE_SCROLL_EVENT,
|
||||
GLFW_CURSOR_ENTER_EVENT,
|
||||
GLFW_JOYSTICK_EVENT
|
||||
};
|
||||
8
include/platforms/core_desktop_sdl.h
Normal file
8
include/platforms/core_desktop_sdl.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// #include "SDL.h"
|
||||
|
||||
enum EventType {
|
||||
SDL_WINDOW_EVENT,
|
||||
SDL_KEYBOARD_EVENT
|
||||
};
|
||||
@@ -13,7 +13,9 @@ typedef struct {
|
||||
Font defaultFont;
|
||||
Material defaultMaterial;
|
||||
int *RLGLcurrentShaderLocs;
|
||||
/* Raylib GLFW input callback events. */
|
||||
/* Events. */
|
||||
/* GLFW events. */
|
||||
#ifdef PLATFORM_DESKTOP
|
||||
/* Window events. */
|
||||
GLFWwindowsizefun raylibWindowSizeCallback;
|
||||
GLFWwindowmaximizefun raylibWindowMaximizeCallback;
|
||||
@@ -28,6 +30,9 @@ typedef struct {
|
||||
GLFWscrollfun raylibMouseScrollCallback;
|
||||
GLFWcursorenterfun raylibCursorEnterCallback;
|
||||
GLFWjoystickfun raylibJoystickCallback;
|
||||
// #elif PLATFORM_DESKTOP_SDL
|
||||
|
||||
#endif
|
||||
} State;
|
||||
|
||||
extern State *state;
|
||||
|
||||
Reference in New Issue
Block a user