mirror of https://github.com/mode777/rayjs.git
fix windows build
This commit is contained in:
parent
92276f1ca6
commit
a314edaef0
|
@ -2,5 +2,6 @@ build/
|
|||
runtime/
|
||||
shaderc
|
||||
hello-bgfx
|
||||
hello-bgfx.exe
|
||||
include/generated/
|
||||
.DS_Store
|
|
@ -17,6 +17,9 @@ set(BX_CONFIG_DEBUG OFF CACHE INTERNAL "" FORCE)
|
|||
# else()
|
||||
# set(BGFX_BUILD_TOOLS OFF CACHE INTERNAL "" FORCE)
|
||||
# endif()
|
||||
|
||||
# needed by windows
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/bgfx.cmake)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/SDL)
|
||||
|
||||
|
|
14
src/common.h
14
src/common.h
|
@ -1,17 +1,22 @@
|
|||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define SDL_MAIN_HANDLED
|
||||
#include <SDL.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint width;
|
||||
uint height;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
} App_Config;
|
||||
|
||||
typedef struct {
|
||||
|
@ -37,4 +42,7 @@ int app_dispose_bgfx();
|
|||
// utiles
|
||||
char* app_read_file(const char* filename, size_t* out_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -1,7 +1,7 @@
|
|||
#include <bgfx/c99/bgfx.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "shaders.h"
|
||||
//#include "shaders.h"
|
||||
|
||||
App_Config app_config = { 640, 480 };
|
||||
App_State app_state = { NULL, 0 };
|
||||
|
@ -24,4 +24,3 @@ int main(int argc, char *argv[]) {
|
|||
app_dispose_quickjs();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue