Compilation succesful on Linux Ubuntu

Probably broke a lot of things
This commit is contained in:
antopilo
2023-09-27 01:48:05 -04:00
parent ed89ca0b8c
commit c15bf532ae
53 changed files with 303 additions and 126 deletions

View File

@@ -44,7 +44,14 @@ bool PopupHelper::DefineTextDialog(const std::string& id, std::string& currentTe
char buffer[256];
memset(buffer, 0, sizeof(buffer));
#ifdef NK_WIN
std::strncpy(buffer, currentText.c_str(), sizeof(buffer));
#endif
#ifdef NK_LINUX
strncpy(buffer, currentText.c_str(), sizeof(buffer));
#endif
if (ImGui::InputText("##label", buffer, sizeof(buffer)))
{
currentText = std::string(buffer);

View File

@@ -3,7 +3,7 @@
#include <src/Vendors/glm/ext/matrix_clip_space.hpp>
#include <src/Rendering/SceneRenderer.h>
#include <src/Resource/ResourceLoader.h>
#include <GL\glew.h>
#include <GL/glew.h>
ThumbnailManager::ThumbnailManager()

View File

@@ -1,11 +1,5 @@
#include "WindowTheming.h"
#include <GLFW/glfw3.h>
#define GLFW_EXPOSE_NATIVE_WIN32
#include <GLFW/glfw3native.h>
#include <dwmapi.h>
namespace WindowTheming
{

View File

@@ -20,7 +20,7 @@
#include "src/Vendors/glm/gtx/matrix_decompose.hpp"
#include "src/Resource/FontAwesome5.h"
#include "Dependencies/GLEW/include/GL/glew.h"
#include "dependencies/GLEW/include/GL/glew.h"
#include "src/Scene/Scene.h"
#include "src/Scene/Components/Components.h"

View File

@@ -10,7 +10,7 @@ project "GLFW"
files
{
"glfw/include/GLFW/glfw3.h",
"glfw/include/GLFW/glfw3native.h",
--"glfw/include/GLFW/glfw3native.h",
"glfw/src/glfw_config.h",
"glfw/src/context.c",
"glfw/src/init.c",
@@ -41,6 +41,31 @@ project "GLFW"
"_GLFW_WIN32",
}
filter "system:linux"
staticruntime "On"
pic "On"
files
{
"glfw/src/x11_init.c",
"glfw/src/x11_monitor.c",
"glfw/src/x11_window.c",
"glfw/src/xkb_unicode.c",
"glfw/src/posix_time.c",
"glfw/src/posix_thread.c",
"glfw/src/glx_context.c",
"glfw/src/egl_context.c",
"glfw/src/osmesa_context.c",
"glfw/src/linux_joystick.c"
}
defines
{
"_GLFW_X11"
}
filter "configurations:Debug"
runtime "Debug"
symbols "on"

View File

@@ -26,10 +26,15 @@ project 'JoltPhysics'
"JoltPhysics/Jolt.cpp",
}
prebuildcommands {
"{COPY} %{prj.location}../Jolt.cpp %{prj.location}"
}
filter "system:windows"
prebuildcommands {
"{COPY} %{prj.location}../Jolt.cpp %{prj.location}"
}
filter "system:not windows"
prebuildcommands {
"cp %{prj.location}./Jolt.cpp %{prj.location}/"
}
filter "configurations:Debug"
cppdialect "C++17"
runtime "Debug"

View File

@@ -9,9 +9,7 @@ project 'Soloud'
targetdir ("soloud/bin/" .. outputdir .. "/%{prj.name}")
objdir ("soloud/bin-obj/" .. outputdir .. "/%{prj.name}")
defines {
"WITH_WASAPI"
}
includedirs {
"soloud/include"
@@ -20,14 +18,32 @@ project 'Soloud'
files {
"soloud/src/**.h",
"soloud/src/core/**.cpp",
"soloud/src/audiosource/**.c*",
"soloud/src/backend/wasapi/**.c*"
"soloud/src/audiosource/**.c*"
}
prebuildcommands {
}
filter "system:windows"
defines {
"WITH_WASAPI"
}
files
{
"soloud/src/backend/wasapi/**.c*"
}
filter "system:linux"
defines {
"WITH_OSS"
}
files
{
"soloud/src/backend/oss/soloud_oss.cpp"
}
filter "configurations:Debug"
cppdialect "C++17"
runtime "Debug"

View File

@@ -2,6 +2,7 @@
#include "src/Core/Core.h"
#include <src/Core/Maths.h>
#include <atomic>
#include <mutex>
#include <thread>

View File

@@ -2,11 +2,15 @@
#include "Engine.h"
#include <GLFW/glfw3.h>
#ifdef NK_WIN
#define GLFW_EXPOSE_NATIVE_WIN32
#include <GLFW/glfw3.h>
#include "GLFW/glfw3native.h"
#include <commdlg.h>
#endif
#include <fstream>
#include <iostream>
@@ -16,6 +20,7 @@ namespace Nuake
std::string FileDialog::OpenFile(const char* filter)
{
#ifdef NK_WIN
OPENFILENAMEA ofn;
CHAR szFile[260] = { 0 };
ZeroMemory(&ofn, sizeof(OPENFILENAME));
@@ -30,12 +35,14 @@ namespace Nuake
{
return ofn.lpstrFile;
}
#endif
return std::string();
}
std::string FileDialog::SaveFile(const char* filter)
{
#ifdef NK_WIN
OPENFILENAMEA ofn;
CHAR szFile[260] = { 0 };
ZeroMemory(&ofn, sizeof(OPENFILENAME));
@@ -50,8 +57,9 @@ namespace Nuake
{
return ofn.lpstrFile;
}
return std::string();
#endif
return std::string();
}
std::string FileSystem::Root = "";

View File

@@ -1,7 +1,7 @@
#include "Input.h"
#include "src/Window.h"
#include <Imgui/imgui_impl_glfw.h>
#include <imgui/imgui_impl_glfw.h>
#include <GLFW/glfw3.h>
namespace Nuake

View File

@@ -14,8 +14,18 @@ namespace Nuake
char buff[100];
time_t now = time(0);
struct tm timeinfo;
#ifdef NK_WIN
localtime_s(&timeinfo, &now);
strftime(buff, 100, "%H:%M:%S", &timeinfo);
#endif
#ifdef NK_LINUX
time_t timeinfo2;
localtime_r(&timeinfo2, &timeinfo);
strftime(buff, 100, "%H:%M:%S", localtime(&now));
#endif
LogEntry newLog = {
type,

View File

@@ -2,7 +2,7 @@
namespace Nuake
{
Quat Nuake::LookAt(Vector3 sourcePoint, Vector3 destPoint)
Quat LookAt(Vector3 sourcePoint, Vector3 destPoint)
{
Vector3 forwardVector = glm::normalize(destPoint - sourcePoint);
@@ -23,7 +23,7 @@ namespace Nuake
}
// just in case you need that function also
Quat Nuake::CreateFromAxisAngle(Vector3 axis, float angle)
Quat CreateFromAxisAngle(Vector3 axis, float angle)
{
float halfAngle = angle * .5f;
float s = sin(halfAngle);
@@ -35,7 +35,7 @@ namespace Nuake
return q;
}
Quat Nuake::QuatFromEuler(float x, float y, float z)
Quat QuatFromEuler(float x, float y, float z)
{
Quat pitchQuat = glm::angleAxis(Rad(x), Vector3(1.0f, 0.0f, 0.0f));
Quat yawQuat = glm::angleAxis(Rad(y), Vector3(0.0f, 1.0f, 0.0f));
@@ -45,12 +45,12 @@ namespace Nuake
return glm::normalize(orientation);
}
Vector3 Nuake::QuatToDirection(const Quat& quat)
Vector3 QuatToDirection(const Quat& quat)
{
return glm::normalize(quat * Vector3(0, 0, -1));
}
void Nuake::Decompose(const Matrix4& m, Vector3& pos, Quat& rot, Vector3& scale)
void Decompose(const Matrix4& m, Vector3& pos, Quat& rot, Vector3& scale)
{
pos = m[3];
for (int i = 0; i < 3; i++)
@@ -62,7 +62,7 @@ namespace Nuake
rot = glm::quat_cast(rotMtx);
}
const Matrix4& Nuake::TransformToCameraTransform(const Matrix4& mat)
const Matrix4& TransformToCameraTransform(const Matrix4& mat)
{
return mat;
}

View File

@@ -2,27 +2,36 @@
#include "src/Window.h"
#include "Engine.h"
#define GLFW_EXPOSE_NATIVE_WIN32
#ifdef NK_WIN
#define GLFW_EXPOSE_NATIVE_WIN32
#include <Windows.h>
#endif
#include "GLFW/glfw3.h"
#include "GLFW/glfw3native.h"
#include <Windows.h>
#include <chrono>
#include <imgui/imgui.h>
namespace Nuake {
void OS::CopyToClipboard(const std::string& value)
{
#ifdef NK_WIN
auto glob = GlobalAlloc(GMEM_FIXED, 512);
memcpy(glob, value.data(), value.size());
OpenClipboard(glfwGetWin32Window(Window::Get()->GetHandle()));
EmptyClipboard();
SetClipboardData(CF_TEXT, glob);
CloseClipboard();
#endif
}
std::string OS::GetFromClipboard()
{
#ifdef NK_WIN
OpenClipboard(nullptr);
HANDLE hData = GetClipboardData(CF_TEXT);
@@ -33,6 +42,9 @@ namespace Nuake {
CloseClipboard();
return text;
#endif
return "";
}
int OS::GetTime()
@@ -42,7 +54,9 @@ namespace Nuake {
void OS::OpenIn(const std::string& filePath)
{
#ifdef NK_WIN
ShellExecuteA(nullptr, "open", filePath.c_str(), nullptr, nullptr, SW_SHOWDEFAULT);
#endif
}
int OS::RenameFile(const Ref<File>& file, const std::string& newName)
@@ -66,16 +80,22 @@ namespace Nuake {
void OS::ShowInFileExplorer(const std::string& filePath)
{
#ifdef NK_WIN
ShellExecuteA(nullptr, "open", "explorer.exe", ("/select," + std::string(filePath)).c_str(), nullptr, SW_SHOWDEFAULT);
#endif
}
void OS::OpenTrenchbroomMap(const std::string& filePath)
{
#ifdef NK_WIN
ShellExecuteA(nullptr, nullptr, Engine::GetProject()->TrenchbroomPath.c_str(), filePath.c_str(), nullptr, SW_SHOW);
#endif
}
void OS::OpenURL(const std::string& url)
{
#ifdef NK_WIN
ShellExecute(nullptr, nullptr, std::wstring(url.begin(), url.end()).c_str(), 0, 0, SW_SHOW);
#endif
}
}

View File

@@ -10,7 +10,7 @@
#include <src/Core/Physics/GhostObject.h>
#include "CharacterController.h"
#include <Jolt/Jolt.h>
#include "Jolt/Jolt.h"
namespace JPH

View File

@@ -1,5 +1,5 @@
#include "Framebuffer.h"
#include <GL\glew.h>
#include "GL/glew.h"
namespace Nuake
{

View File

@@ -1,5 +1,5 @@
#include "MSAAFramebuffer.h"
#include <GL\glew.h>
#include <GL/glew.h>
namespace Nuake
{

View File

@@ -29,43 +29,63 @@ namespace Nuake {
unsigned int m_Stride;
public:
VertexBufferLayout() : m_Stride(0) {};
VertexBufferLayout() : m_Stride(0) {}
template<typename T>
void Push(unsigned int count)
{
}
template<>
void Push<float>(unsigned int count)
{
m_Elements.push_back({ RendererEnum::FLOAT, count, false });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::FLOAT) * count;
}
template<>
void Push<unsigned int>(unsigned int count)
{
m_Elements.push_back({ RendererEnum::UINT, count, false });
if constexpr (std::is_same_v<T, float*>)
{
m_Elements.push_back({ RendererEnum::FLOAT, count, false });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::FLOAT) * count;
}
if constexpr (std::is_same_v<T, unsigned int*>)
{
m_Elements.push_back({ RendererEnum::UINT, count, false });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::UINT) * count;
}
}
template<>
void Push<int>(unsigned int count)
{
m_Elements.push_back({ RendererEnum::INT, count, false });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::INT) * count;
}
if constexpr (std::is_same_v<T, int*>)
{
m_Elements.push_back({ RendererEnum::INT, count, false });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::INT) * count;
}
template<>
void Push<unsigned char>(unsigned int count)
{
m_Elements.push_back({ RendererEnum::UBYTE, count, true });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::UBYTE) * count;
if constexpr (std::is_same_v<T, int*>)
{
m_Elements.push_back({ RendererEnum::UBYTE, count, true });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::UBYTE) * count;
}
}
inline const std::vector<VertexBufferElement>& GetElements() const { return m_Elements; }
inline unsigned int GetStride() const { return m_Stride; }
};
#ifdef NK_WIN
template<>
void VertexBufferLayout::Push<unsigned int>(unsigned int count)
{
m_Elements.push_back({ RendererEnum::UINT, count, false });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::UINT) * count;
};
template<>
void VertexBufferLayout::Push<int>(unsigned int count)
{
m_Elements.push_back({ RendererEnum::INT, count, false });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::INT) * count;
};
template<>
void VertexBufferLayout::Push<unsigned char>(unsigned int count)
{
m_Elements.push_back({ RendererEnum::UBYTE, count, true });
m_Stride += VertexBufferElement::GetSizeOfType(RendererEnum::UBYTE) * count;
};
#endif
}

View File

@@ -42,7 +42,7 @@ namespace Nuake
return m_Indices;
}
Ref<Material> Mesh::GetMaterial() inline const
Ref<Material> Mesh::GetMaterial() const
{
return m_Material;
}

View File

@@ -22,7 +22,7 @@ namespace Nuake
std::vector<Vertex>& GetVertices();
std::vector<uint32_t>& GetIndices();
Ref<Material> GetMaterial() inline const;
Ref<Material> GetMaterial() const;
void SetMaterial(Ref<Material> material);
void Bind() const;

View File

@@ -40,7 +40,7 @@ namespace Nuake
return m_Indices;
}
Ref<Material> SkinnedMesh::GetMaterial() inline const
Ref<Material> SkinnedMesh::GetMaterial() const
{
return m_Material;
}

View File

@@ -27,7 +27,7 @@ namespace Nuake
std::vector<SkinnedVertex>& GetVertices();
std::vector<uint32_t>& GetIndices();
Ref<Material> GetMaterial() inline const;
Ref<Material> GetMaterial() const;
void SetMaterial(Ref<Material> material);
void Bind() const;

View File

@@ -5,7 +5,7 @@
#include "src/Rendering/Shaders/ShaderManager.h"
#include "src/Rendering/Renderer.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include <random>
#include <src/Vendors/imgui/imgui.h>

View File

@@ -1,7 +1,7 @@
#pragma once
#include "src/Core/Core.h"
#include "src/Core/Maths.h"
#include "src/Rendering/Buffers/FrameBuffer.h"
#include "src/Rendering/Buffers/Framebuffer.h"
#include "src/Scene/Components/LightComponent.h"
#include <vector>

View File

@@ -12,7 +12,7 @@ namespace Nuake
{
struct RenderMesh
{
Ref<Mesh> Mesh;
Ref<Mesh> mesh;
Matrix4 transform;
int32_t entityId;
};
@@ -62,7 +62,7 @@ namespace Nuake
}
shader->SetUniformMat4f(modelMatrixUniformLocation, m.transform);
m.Mesh->Draw(shader, false);
m.mesh->Draw(shader, false);
}
}

View File

@@ -1,6 +1,6 @@
#include "Renderer.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include "RenderCommand.h"

View File

@@ -5,7 +5,7 @@
#include "src/Scene/Components/SpriteComponent.h"
#include "src/Scene/Components/ParticleEmitterComponent.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include <src/Scene/Components/SkinnedModelComponent.h>
#include <src/Vendors/imgui/imgui.h>

View File

@@ -1,11 +1,10 @@
#pragma once
#include "src/Core/Core.h"
#include "Shader.h"
#include "src/Core/FileSystem.h"
#include "src/Core/Logger.h"
#include <sstream>
#include <GL\glew.h>
#include <GL/glew.h>
namespace Nuake

View File

@@ -1,4 +1,3 @@
#pragma once
#include "ShaderManager.h"
#include "src/Core/Logger.h"

View File

@@ -1,5 +1,5 @@
#include "Cubemap.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include <iostream>
#include "HDR.h"

View File

@@ -1,5 +1,5 @@
#include "HDR.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include <iostream>
#include "src/Rendering/Renderer.h"

View File

@@ -1,5 +1,5 @@
#include "MultiSampledTexture.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include <iostream>
namespace Nuake

View File

@@ -1,6 +1,6 @@
#include "Texture.h"
#include "src/Core/Logger.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include <iostream>
#include <src/Core/FileSystem.h>

View File

@@ -2,7 +2,7 @@
#include "src/Rendering/Textures/Texture.h"
#include "src/Resource/StaticResources.h"
#include <GL\glew.h>
#include <GL/glew.h>
namespace Nuake
{

View File

@@ -1,5 +1,5 @@
#include "FDGSerializer.h"
#include <src\Core\FileSystem.h>
#include <src/Core/FileSystem.h>
namespace Nuake {
bool FGDSerializer::BeginFGDFile(const std::string path)

View File

@@ -1,6 +1,6 @@
#pragma once
#include <cstdint>
#include <xhash>
#include <functional>
namespace Nuake
{

View File

@@ -3,7 +3,7 @@
#include "LightComponent.h"
#include "src/Rendering/Renderer.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include "src/Core/Core.h"
#include <src/Scene/Entities/ImGuiHelper.h>

View File

@@ -5,7 +5,7 @@
namespace Nuake {
class TriggerZone {
public:
Ref<GhostObject> GhostObject;
Ref<GhostObject> m_GhostObject;
std::string target = "";
std::vector<Entity> Targets;
@@ -20,7 +20,7 @@ namespace Nuake {
{
if (!Enabled) return 0;
return GhostObject->OverlappingCount();
return m_GhostObject->OverlappingCount();
}
std::vector<Entity> GetTargets() {
@@ -32,7 +32,7 @@ namespace Nuake {
if (!Enabled)
return std::vector<Entity>();
return GhostObject->GetOverlappingEntities();
return m_GhostObject->GetOverlappingEntities();
}
};
}

View File

@@ -1,5 +1,5 @@
#include "Skybox.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include "src/Rendering/Renderer.h"
#include "src/Rendering/Textures/Cubemap.h"

View File

@@ -1,5 +1,5 @@
#include "SkyboxHDR.h"
#include <GL\glew.h>
#include <GL/glew.h>
#include "src/Rendering/Renderer.h"
#include "src/Rendering/Textures/Cubemap.h"
@@ -294,8 +294,8 @@ namespace Nuake {
for (unsigned int mip = 0; mip < maxMipLevels; ++mip)
{
// reisze framebuffer according to mip-level size.
unsigned int mipWidth = unsigned int(1024 * std::pow(0.5f, mip));
unsigned int mipHeight = unsigned int(1024 * std::pow(0.5f, mip));
uint32_t mipWidth = 1024 * std::pow(0.5f, mip);
uint32_t mipHeight = 1024 * std::pow(0.5f, mip);
glBindRenderbuffer(GL_RENDERBUFFER, captureRBO);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, mipWidth, mipHeight);
glViewport(0, 0, mipWidth, mipHeight);

View File

@@ -8,7 +8,6 @@ namespace Nuake
Vector3 Position;
Vector3 Velocity;
float Scale;
Color Color;
float Life;
};
}

View File

@@ -48,7 +48,6 @@ namespace Nuake
initialPosition,
initialVelocity,
Scale,
initialColor,
initialLife
});

View File

@@ -19,7 +19,7 @@ namespace Nuake {
void RegisterModule(WrenVM* vm) override
{
RegisterMethod("GetMouseX()", GetMouseX);
RegisterMethod("GetMouseX()", (void*)GetMouseX);
RegisterMethod("GetMouseY()", (void*)GetMouseY);
RegisterMethod("IsKeyDown_(_)", (void*)IsKeyDown);

View File

@@ -116,9 +116,6 @@ namespace Nuake
style.Position.Bottom.mUnit = (Layout::Unit)s.second.type;
style.Position.Bottom.Value = s.second.value.Number;
break;
case PropType::BACKGROUND_COLOR:
style.BackgroundColor = s.second.value.Color;
break;
}
}

View File

@@ -84,7 +84,7 @@ namespace Nuake
union Value
{
float Number;
Color Color;
Color Color_;
int Enum;
};
struct PropValue

View File

@@ -72,7 +72,6 @@ namespace Nuake
PropValueType::COLOR,
{0},
};
data.value.Color = Color(r, g, b, a);
return data;
}
}

View File

@@ -12,9 +12,18 @@
#include <string.h>
#include <stdbool.h>
#include <assert.h>
strncasecmp(const char* a, const char* b)
#ifdef _WIN32
#include <string.h> // for _stricmp on Windows
#else
#include <strings.h> // for strcasecmp on non-Windows platforms
#endif
int strncasecmp(const char* a, const char* b, size_t n)
{
return _stricmp(a, b);
#ifdef _WIN32
return _strnicmp(a, b, n); // Case-insensitive comparison on Windows
#else
return strncasecmp(a, b, n); // Case-insensitive comparison on non-Windows platforms
#endif
}
//#undef assert
//#define assert(x)
@@ -87,7 +96,13 @@ bool katana_string_has_prefix(const char* str, const char* prefix)
{
size_t pre_len = strlen(prefix);
size_t str_len = strlen(str);
return pre_len <= str_len && strncasecmp(prefix, str, pre_len);
// Ensure that the prefix length is less than or equal to the string length
if (pre_len <= str_len) {
return strncmp(prefix, str, pre_len) == 0;
}
return false;
}
void katana_string_to_lowercase(struct KatanaInternalParser* parser,

View File

@@ -1927,7 +1927,11 @@ extern int katanalex \
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
#endif
#ifndef YY_EXTRA_TYPE

View File

@@ -235,7 +235,11 @@ void katanafree (void * ,yyscan_t yyscanner );
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
#endif
#ifndef YY_EXTRA_TYPE

View File

@@ -26,7 +26,12 @@
#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
}
#undef assert
#define assert(x)

View File

@@ -8,6 +8,16 @@
#include <string.h>
#include <stdio.h>
int entity_count;
entity *entities;
entity_geometry *entity_geo;
int texture_count;
texture_data *textures;
int worldspawn_layer_count;
worldspawn_layer *worldspawn_layers;
void map_data_reset()
{
if (entities != NULL)

View File

@@ -1,3 +1,4 @@
#pragma once
#ifndef MAP_DATA_H
#define MAP_DATA_H
@@ -18,15 +19,15 @@ typedef struct worldspawn_layer
bool build_visuals;
} worldspawn_layer;
int entity_count;
entity *entities;
entity_geometry *entity_geo;
extern int entity_count;
extern entity *entities;
extern entity_geometry *entity_geo;
int texture_count;
texture_data *textures;
extern int texture_count;
extern texture_data *textures;
int worldspawn_layer_count;
worldspawn_layer *worldspawn_layers;
extern int worldspawn_layer_count;
extern worldspawn_layer *worldspawn_layers;
void map_data_reset();

View File

@@ -1,6 +1,6 @@
#include <Engine.h>
#include <dependencies/GLEW/include/GL/glew.h>
//#include <dependencies/GLEW/include/GL/glew.h>
#include <src/Vendors/imgui/imgui.h>
#include <string>
@@ -45,7 +45,7 @@ int ApplicationMain(int argc, char* argv[])
Engine::Draw();
const auto& WindowSize = window->GetSize();
glViewport(0, 0, WindowSize.x, WindowSize.y);
//glViewport(0, 0, WindowSize.x, WindowSize.y);
Nuake::Renderer2D::BeginDraw(WindowSize);
ImGuiViewport* viewport = ImGui::GetMainViewport();

View File

@@ -56,17 +56,17 @@ project "Nuake"
{
"%{prj.name}/../Nuake",
"%{prj.name}/../Nuake/src/Vendors",
"%{prj.name}/../Nuake/Dependencies/GLEW/include",
"%{prj.name}/../Nuake/Dependencies/GLFW/include",
"%{prj.name}/../Nuake/Dependencies/assimp/include",
"%{prj.name}/../Nuake/Dependencies/JoltPhysics",
"%{prj.name}/../Nuake/dependencies/GLEW/include",
"%{prj.name}/../Nuake/dependencies/glfw/include",
"%{prj.name}/../Nuake/dependencies/assimp/include",
"%{prj.name}/../Nuake/dependencies/JoltPhysics",
"%{prj.name}/../Nuake/src/Vendors/msdfgen/include",
"%{prj.name}/../Nuake/src/Vendors/msdfgen/freetype/include",
"%{prj.name}/../Nuake/src/Vendors/msdfgen",
"%{prj.name}/../Nuake/src/Vendors/wren/src/include",
"%{prj.name}/../Nuake/src/Vendors/incbin",
"%{prj.name}/../Nuake/Dependencies/build",
"%{prj.name}/../Nuake/Dependencies/soloud/include"
"%{prj.name}/../Nuake/dependencies/build",
"%{prj.name}/../Nuake/dependencies/soloud/include"
}
links
@@ -75,12 +75,22 @@ project "Nuake"
"soloud"
}
filter "system:linux"
cppdialect "C++20"
staticruntime "On"
defines {
"NK_LINUX",
"GLFW_STATIC",
"GLEW_NO_GLU"
}
filter "system:windows"
cppdialect "C++20"
staticruntime "On"
defines {
"NK_WIN"
}
buildoptions { "-permissive", "-cxxflags"}
filter "configurations:Debug"
runtime "Debug"
@@ -133,6 +143,7 @@ project "NuakeRuntime"
libdirs
{
"%{prj.name}/../Nuake/dependencies/GLEW/lib/Release/x64",
"%{prj.name}/../Nuake/dependencies/GLEW/lib/Release/Linux",
"%{prj.name}/../Nuake/dependencies/assimp/lib/",
"%{prj.name}/../Nuake/dependencies/freetype-windows-binaries/release static/win64",
"%{prj.name}/../bin/%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}/Nuake/",
@@ -149,8 +160,6 @@ project "NuakeRuntime"
"Nuake",
"GLFW",
"assimp",
"glew32s.lib",
"opengl32.lib",
"Freetype",
"JoltPhysics",
"soloud"
@@ -162,6 +171,17 @@ project "NuakeRuntime"
defines {
"NK_WIN"
}
links
{
"opengl32.lib"
}
filter "system:linux"
links
{
"GL",
"GLEW"
}
filter "configurations:Debug"
runtime "Debug"
@@ -209,23 +229,21 @@ project "Editor"
{
"%{prj.name}/Editor.cpp",
"%{prj.name}/src/**.cpp",
"%{prj.name}/src/**.h",
"%{prj.name}/resources/*.rc",
"%{prj.name}/resources/**.ico"
"%{prj.name}/src/**.h"
}
includedirs
{
"%{prj.name}/../Nuake",
"%{prj.name}/../Nuake/src/Vendors",
"%{prj.name}/../Nuake/Dependencies/GLEW/include",
"%{prj.name}/../Nuake/Dependencies/GLFW/include",
"%{prj.name}/../Nuake/Dependencies/assimp/include",
"%{prj.name}/../Nuake/Dependencies/build",
"%{prj.name}/../Nuake/dependencies/GLEW/include",
"%{prj.name}/../Nuake/dependencies/glfw/include",
"%{prj.name}/../Nuake/dependencies/assimp/include",
"%{prj.name}/../Nuake/dependencies/build",
"%{prj.name}/../Nuake/src/Vendors/msdfgen",
"%{prj.name}/../Nuake/Dependencies/JoltPhysics",
"%{prj.name}/../Nuake/Dependencies/build",
"%{prj.name}/../Nuake/Dependencies/soloud/include"
"%{prj.name}/../Nuake/dependencies/JoltPhysics",
"%{prj.name}/../Nuake/dependencies/build",
"%{prj.name}/../Nuake/dependencies/soloud/include"
}
libdirs
@@ -244,11 +262,10 @@ project "Editor"
links
{
"Nuake",
"Nuake",
"GLEW",
"GLFW",
"assimp",
"glew32s.lib",
"opengl32.lib",
"Freetype",
"JoltPhysics",
"soloud"
@@ -257,6 +274,29 @@ project "Editor"
filter "system:windows"
cppdialect "C++20"
staticruntime "On"
links
{
"OpenGL32"
}
files
{
"%{prj.name}/resources/*.rc",
"%{prj.name}/resources/**.ico"
}
filter "system:linux"
links
{
"GL",
"GLEW",
"X11"
}
cppdialect "C++20"
staticruntime "On"
defines {
"NK_LINUX",
"GLFW_STATIC"
}
filter "configurations:Debug"
runtime "Debug"