Remove nuklear from engine
This commit is contained in:
@@ -6,19 +6,22 @@ set(CMAKE_C_STANDARD 11)
|
||||
add_compile_definitions(DEBUG_MODE)
|
||||
|
||||
set(BUILD_EXAMPLES false)
|
||||
add_subdirectory(libs/raylib-4.5.0)
|
||||
add_subdirectory(libs/cimgui)
|
||||
add_subdirectory(libs/flecs)
|
||||
add_subdirectory(libs/raylib-4.5.0)
|
||||
add_subdirectory(libs/rlImGui)
|
||||
|
||||
target_link_libraries(rlImGui cimgui raylib)
|
||||
|
||||
set(librarySources
|
||||
libs/cute_tiled/cute_tiled.c
|
||||
libs/nuklear/nuklear.c
|
||||
libs/raygui/raygui.c
|
||||
)
|
||||
|
||||
set(libraryDirs
|
||||
libs/cute_tiled
|
||||
libs/nuklear
|
||||
libs/raygui
|
||||
libs/rlImGui
|
||||
)
|
||||
|
||||
|
||||
@@ -66,7 +69,7 @@ add_library(Breeze STATIC
|
||||
set_target_properties(Breeze PROPERTIES
|
||||
PUBLIC_HEADER "${BreezeHeaders}")
|
||||
|
||||
target_link_libraries(Breeze raylib flecs::flecs_static)
|
||||
target_link_libraries(Breeze raylib flecs::flecs_static rlImGui)
|
||||
|
||||
#target_include_directories(Breeze PUBLIC .)
|
||||
target_include_directories(Breeze
|
||||
|
||||
@@ -30,7 +30,6 @@ extern struct nk_context *NK;
|
||||
extern bool bzMain(BzAppDesc *appDesc, int argc, const char **argv);
|
||||
|
||||
#ifdef BZ_ENTRYPOINT
|
||||
#include <raylib-nuklear.h>
|
||||
#include <flecs.h>
|
||||
|
||||
struct nk_context *NK = NULL;
|
||||
@@ -94,9 +93,6 @@ int main(int argc, const char **argv) {
|
||||
SetTargetFPS(appDesc.fps);
|
||||
// Initialize modules
|
||||
|
||||
if (appDesc.useNuklear) {
|
||||
NK = InitNuklear(16);
|
||||
}
|
||||
if (appDesc.useFlecs) {
|
||||
ECS = ecs_init();
|
||||
}
|
||||
@@ -108,8 +104,6 @@ int main(int argc, const char **argv) {
|
||||
|
||||
while (!WindowShouldClose()) {
|
||||
float dt = GetFrameTime();
|
||||
if (NK)
|
||||
UpdateNuklear(NK);
|
||||
if (appDesc.update)
|
||||
appDesc.update(dt, appDesc.userData);
|
||||
|
||||
@@ -119,8 +113,6 @@ int main(int argc, const char **argv) {
|
||||
BeginDrawing();
|
||||
if (appDesc.render)
|
||||
appDesc.render(dt, appDesc.userData);
|
||||
if (NK)
|
||||
DrawNuklear(NK);
|
||||
EndDrawing();
|
||||
}
|
||||
|
||||
@@ -133,10 +125,6 @@ int main(int argc, const char **argv) {
|
||||
ecs_fini(ECS);
|
||||
ECS = NULL;
|
||||
}
|
||||
if (NK) {
|
||||
UnloadNuklear(NK);
|
||||
NK = NULL;
|
||||
}
|
||||
|
||||
CloseWindow();
|
||||
bzLoggerDeinit();
|
||||
|
||||
@@ -3,8 +3,5 @@ project(BreezeTests)
|
||||
add_executable(window_test window_test.c)
|
||||
target_link_libraries(window_test LINK_PRIVATE Breeze)
|
||||
|
||||
add_executable(nuklear_test nuklear_test.c)
|
||||
target_link_libraries(nuklear_test LINK_PRIVATE Breeze)
|
||||
|
||||
add_executable(cute_tiled_test cute_tiled_test.c)
|
||||
target_link_libraries(cute_tiled_test LINK_PRIVATE Breeze)
|
||||
|
||||
@@ -2,14 +2,27 @@
|
||||
#include <breeze.h>
|
||||
|
||||
#include <raylib.h>
|
||||
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
|
||||
#include <rlImGui.h>
|
||||
#include <cimgui.h>
|
||||
|
||||
bool init(int *game) {
|
||||
rlImGuiSetup(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void render(float dt, int *game) {
|
||||
ClearBackground(WHITE);
|
||||
BeginDrawing();
|
||||
EndDrawing();
|
||||
|
||||
rlImGuiBegin();
|
||||
igShowDemoWindow(NULL);
|
||||
rlImGuiEnd();
|
||||
}
|
||||
|
||||
bool bzMain(BzAppDesc *appDesc, int argc, const char **argv) {
|
||||
appDesc->init = (BzAppInitFunc) init;
|
||||
appDesc->render = (BzAppRenderFunc) render;
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user