Conditional branch for linux

This commit is contained in:
Antoine Pilote
2023-09-27 23:37:31 -04:00
parent 8f6abcf7a7
commit 1aae2e3ea7
5 changed files with 19 additions and 11 deletions

View File

@@ -34,6 +34,7 @@ namespace Nuake
// Creates the window
s_CurrentWindow = Window::Get();
Logger::Log("Input initializing");
Input::Init();
Renderer2D::Init();
Logger::Log("Engine initialized");

View File

@@ -28,8 +28,13 @@ namespace Nuake {
m_Soloud = CreateRef<SoLoud::Soloud>();
// TODO: Sample rate, back end, buffer size, flags.
m_Soloud->init(SoLoud::Soloud::CLIP_ROUNDOFF,SoLoud::Soloud::ALSA);
#ifdef NK_WIN
m_Soloud->init();
#endif
#ifdef NK_LINUX
m_Soloud->init(SoLoud::Soloud::CLIP_ROUNDOFF, SoLoud::Soloud::ALSA)
#endif
m_AudioThread = std::thread(&AudioManager::AudioThreadLoop, this);
Logger::Log("Audio manager initialized", "audio", VERBOSE);

View File

@@ -17,6 +17,7 @@ namespace Nuake
void Renderer2D::Init()
{
Logger::Log("Renderer 2D initiaizing", "render2d");
UIShader = ShaderManager::GetShader("Resources/Shaders/ui.shader");
TextShader = ShaderManager::GetShader("Resources/Shaders/sdf_text.shader");
@@ -30,6 +31,8 @@ namespace Nuake
1.0f, 1.0f, 1.0f, 1.0f, 1.0f
};
Logger::Log("Renderer 2D create VAOS", "render2d");
// setup plane VAO
glGenVertexArrays(1, &Renderer2D::VAO);
glGenBuffers(1, &Renderer2D::VBO);

View File

@@ -79,7 +79,6 @@ namespace Nuake {
{"ScriptableEntity", GET_STATIC_RESOURCE_SCRIPT_SRC(StaticResources::Resources_Scripts_ScriptableEntity_wren)},
};
const std::string NuakeModulePrefix = "Nuake:";
WrenLoadModuleResult myLoadModule(WrenVM* vm, const char* name)
{

View File

@@ -24,15 +24,15 @@
#include <string.h>
#include <assert.h>
#include <string.h>
// strcasecmp(const char* a, const char* b)
// {
// #ifdef NK_WIN
// return _stricmp(a, b);
// #endif
// #ifdef NK_LINUX
// return strcasecmp(a, b);
// #endif
// }
#ifdef NK_WIN
strcasecmp(const char* a, const char* b)
{
return _stricmp(a, b);
}
#endif
#undef assert
#define assert(x)