Skip to content

Commit

Permalink
start prep for new core
Browse files Browse the repository at this point in the history
  • Loading branch information
GlynLeine committed Nov 19, 2024
1 parent 76a2ddd commit 60901ea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/core/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ namespace rythe
}
}

namespace ryt = rythe;
namespace rte = rythe;
28 changes: 16 additions & 12 deletions src/core/entry/entry_point.hpp
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
#pragma once
#include <iostream>
#include <rsl/logging>
#include <rsl/primitives>
#include <rsl/type_util>
#include <rsl/logging>

#include "..\program\program.hpp"

/**
* @file entry_point.hpp
* @brief When RYTHE_ENTRY is defined, this file will create a function with signature main(int,char**) -> int
* implementing the common main function of a c++ program.
* @note When defining RYTHE_ENTRY do no create your own CRT_STARTUP such as main()->int, main(int,char**)->int, wmain(), etc...
* @note When defining RYTHE_ENTRY do no create your own CRT_STARTUP such as main()->int, main(int,char**)->int,
* wmain(), etc...
* @note When using RYTHE_ENTRY you must instead implement reportModules(rythe::core::Engine*).
* @note When not using RYTHE_ENTRY you must call creation and initialization of the engine manually.
*/


/**@brief Reports engine modules to the engine, must be implemented by you.
* @param [in] engine The engine object as ptr *
* @ref rythe::core::Engine::reportModule<T,...>()
*/
extern void reportModules(rythe::core::Program* program);
/**@brief Reports engine modules to the engine, must be implemented by you.
* @param [in] engine The engine object as ptr *
* @ref rythe::core::Engine::reportModule<T,...>()
*/
extern int reportModules(rythe::core::Program& program);

#if defined(RYTHE_ENTRY)

#if defined(RYTHE_WINDOWS)
#if defined(RYTHE_WINDOWS)
__declspec(dllexport) DWORD NvOptimusEnablement = 0x0000001;
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
#endif
#endif


int main(int argc, char** argv)
{
rsl::log::setup();
rythe::core::Program program;
reportModules(&program);
if (int result = reportModules(program); result != 0)
{
return result;
}

program.initialize();

int maxFrames = 1000;
Expand All @@ -44,12 +49,11 @@ int main(int argc, char** argv)
{
program.update();
count++;
if(count >= maxFrames)
if (count >= maxFrames)
program.stop();
}

program.shutdown();
return 0;
}
#endif

0 comments on commit 60901ea

Please sign in to comment.