Changes fixes
This commit is contained in:
parent
699abc3191
commit
0b65336b81
@ -23,6 +23,11 @@ target_include_directories(DeerithClient
|
|||||||
${IMGUI_INCLUDE_DIRS}
|
${IMGUI_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_include_directories(DeerithClient
|
||||||
|
PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(DeerithClient
|
target_link_libraries(DeerithClient
|
||||||
PUBLIC
|
PUBLIC
|
||||||
DeerithCore
|
DeerithCore
|
||||||
|
|||||||
21
deerith_engine_client/src/engine.cpp
Normal file
21
deerith_engine_client/src/engine.cpp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#include <deerith/engine.h>
|
||||||
|
#include <deerith/core/core.h>
|
||||||
|
|
||||||
|
#include "network/network_internals.h"
|
||||||
|
|
||||||
|
namespace deerith
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void deerith::init_engine()
|
||||||
|
{
|
||||||
|
init_deerith_core();
|
||||||
|
init_network();
|
||||||
|
}
|
||||||
|
|
||||||
|
void deerith::shutdown_enigne()
|
||||||
|
{
|
||||||
|
shutdown_deerith_core();
|
||||||
|
shutdown_network();
|
||||||
|
}
|
||||||
@ -73,7 +73,6 @@ int deerith::init_window()
|
|||||||
|
|
||||||
init_primitives();
|
init_primitives();
|
||||||
init_imgui();
|
init_imgui();
|
||||||
init_network();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace deerith
|
|
||||||
{
|
|
||||||
class Client
|
|
||||||
{
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace deerith
|
|
||||||
{
|
|
||||||
void connect_to_server();
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
namespace deerith
|
|
||||||
{
|
|
||||||
using world_tick_function = std::function<void(int current_tick)>;
|
|
||||||
|
|
||||||
void set_world_tick_callback(world_tick_function *tick_function);
|
|
||||||
}
|
|
||||||
@ -4,4 +4,7 @@ namespace deerith
|
|||||||
{
|
{
|
||||||
void init_log();
|
void init_log();
|
||||||
void shutdown_log();
|
void shutdown_log();
|
||||||
|
|
||||||
|
void init_network();
|
||||||
|
void shutdown_network();
|
||||||
}
|
}
|
||||||
@ -1,32 +1,22 @@
|
|||||||
|
#include "client/window.h"
|
||||||
|
#include <deerith/core/log.h>
|
||||||
|
|
||||||
#include <deerith/graphics/window.h>
|
#include <deerith/graphics/window.h>
|
||||||
#include <deerith/graphics/primitive.h>
|
#include <deerith/graphics/primitive.h>
|
||||||
#include <deerith/graphics/input.h>
|
#include <deerith/graphics/input.h>
|
||||||
#include <deerith/core/core.h>
|
|
||||||
#include <deerith/universe/universe.h>
|
#include <deerith/universe/universe.h>
|
||||||
#include <iostream>
|
#include <deerith/engine.h>
|
||||||
#include <math.h>
|
|
||||||
#include <imgui.h>
|
|
||||||
|
|
||||||
#include "deerith/core/log.h"
|
#include <imgui/imgui.h>
|
||||||
|
|
||||||
glm::vec2 player_pos(5, 5);
|
glm::vec2 player_pos(5, 5);
|
||||||
|
|
||||||
char net_address[16] = "127.0.0.1";
|
char net_address[16] = "127.0.0.1";
|
||||||
int port = 8080;
|
int port = 8080;
|
||||||
|
|
||||||
float vel = 1;
|
float vel = 1;
|
||||||
|
|
||||||
int main(int args_count, const char **args)
|
void start_window_loop()
|
||||||
{
|
{
|
||||||
deerith::init_deerith_core();
|
deerith_client_assert(deerith::init_window() == 0, "Failed to init_window");
|
||||||
|
|
||||||
deerith_core_trace("{}", args[0]);
|
|
||||||
|
|
||||||
int init_result = deerith::init_window();
|
|
||||||
if (init_result != 0)
|
|
||||||
{
|
|
||||||
return init_result;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (deerith::begin_window_display())
|
while (deerith::begin_window_display())
|
||||||
{
|
{
|
||||||
@ -62,6 +52,4 @@ int main(int args_count, const char **args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
deerith::shutdown_window();
|
deerith::shutdown_window();
|
||||||
deerith::shutdown_deerith_core();
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
void execute_window();
|
void start_window_loop();
|
||||||
@ -1,24 +1,24 @@
|
|||||||
|
|
||||||
#include <deerith/core/core.h>
|
|
||||||
#include <deerith/core/log.h>
|
|
||||||
#include <deerith/engine.h>
|
#include <deerith/engine.h>
|
||||||
|
|
||||||
#ifdef DEERITH_SERVER
|
#ifdef DEERITH_CLIENT
|
||||||
#include <client/
|
#include "client/window.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEERITH_SERVER
|
||||||
|
#include "server/server.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int main(int args_count, const char **args)
|
||||||
|
{
|
||||||
|
deerith::init_engine();
|
||||||
|
|
||||||
#ifdef DEERITH_CLIENT
|
#ifdef DEERITH_CLIENT
|
||||||
|
start_window_loop();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main()
|
#ifdef DEERITH_SERVER
|
||||||
{
|
init_server();
|
||||||
deerith::init_deerith_core();
|
#endif
|
||||||
|
|
||||||
int init_result = deerith::init_window();
|
|
||||||
if (init_result != 0)
|
|
||||||
{
|
|
||||||
return init_result;
|
|
||||||
}
|
|
||||||
|
|
||||||
deerith::shutdown_enigne();
|
deerith::shutdown_enigne();
|
||||||
}
|
}
|
||||||
@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
#include <deerith/core/core.h>
|
|
||||||
#include <deerith/core/log.h>
|
|
||||||
|
|
||||||
int main(int args_count, const char **args)
|
|
||||||
{
|
|
||||||
deerith::init_deerith_core();
|
|
||||||
|
|
||||||
deerith_core_trace("Running server\n{}", args[0]);
|
|
||||||
|
|
||||||
deerith::shutdown_deerith_core();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
5
sandbox/src/server/server.cpp
Normal file
5
sandbox/src/server/server.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#include "server/server.h"
|
||||||
|
|
||||||
|
void init_server()
|
||||||
|
{
|
||||||
|
}
|
||||||
3
sandbox/src/server/server.h
Normal file
3
sandbox/src/server/server.h
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
void init_server();
|
||||||
Loading…
x
Reference in New Issue
Block a user