diff --git a/.gitignore b/.gitignore index 9f106f2..c9b09ad 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ build/ runtime/ shaderc hello-bgfx +hello-bgfx.exe include/generated/ .DS_Store \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 77635b5..e7aa8a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/common.h b/src/common.h index b7b50c4..21b6311 100644 --- a/src/common.h +++ b/src/common.h @@ -1,17 +1,22 @@ #ifndef COMMON_H #define COMMON_H +#ifdef __cplusplus +extern "C" +{ +#endif + #include #include #include #include - +#define SDL_MAIN_HANDLED #include 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 \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 8144d39..5c7eb5a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,7 @@ #include #include "common.h" -#include "shaders.h" +//#include "shaders.h" App_Config app_config = { 640, 480 }; App_State app_state = { NULL, 0 }; @@ -23,5 +23,4 @@ int main(int argc, char *argv[]) { app_dispose_sdl(); app_dispose_quickjs(); return 0; -} - +} \ No newline at end of file