-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linux support (updated) #27
Conversation
wow |
Linux setup instructions
…d added common ones
I merged a PR made by @DaveAxiom in my fork that adds a README.md file with the necessary steps to build Hazel on Linux (as well as some basic info). |
@@ -1,27 +1,37 @@ | |||
#pragma once | |||
|
|||
#ifdef HZ_PLATFORM_WINDOWS | |||
#if defined HZ_PLATFORM_WINDOWS | |||
#define HZ_DEBUG_BREAK { __debugbreak(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be cleaner to use function macros?
#define HZ_DEBUG_BREAK { __debugbreak(); } | |
#define HZ_DEBUG_BREAK() __debugbreak() |
@WhoseTheNerd I did it to be consistent with other macros. For example, HZ_ASSERT is just an if statement with its own braces. However, it is still surrounded by braces. Not how I would do it, but to follow the existing style. |
On Majaro 18.0.3, I am getting
This may have something to do with
Any suggestions? |
@ritobanrc I think they are two separate issues. On the other hand, I have not dedicated enough time to check those shaders, but by the looks of it, your hardware/drivers do not support the necessary OpenGL version. This could be solved by installing the latest drivers for your video card. |
Wow that's a lot of work, awesome! I do think that there should be a separate |
@cubedtear I just re-cloned the project, and the submodule issue seems to have resolved itself. However, I'm still getting the issue with OpenGL and ImGui. This is the output of
I have I also tested the |
@ritobanrc I had the same issue. |
I suggest keeping the indentation method to tabs like it was before. it will make for a more pleasant diff and will comply with the current style of the engine. It will also be easier to merge. |
https://github.com/cubedtear/Hazel/tree/master/Hazel/vendor |
@cubedtear Just to let you know I implemented your changes into my code running on Ubuntu 18.04 and it works perfectly! Thanks for your job! I'm working on my own version of the code here (https://github.com/NiGhMa/Hazelicious) |
Thank you for your kind words, @NiGhMa, both in the comment and in the shoutout on your readme! I have been a little absent in this project lately, but I'm truly glad this was helpful 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In discord was asked if this can be looked at; I would suggest:
- update premake files in submodules (see inital post)
- fast forward the branch (pull master into this) so it can be merged
- ask someone with write acces to review (gaztin for example)
- wait till thecherno wants to make a video about this since this is not "just a bugfix"
@@ -1,27 +1,37 @@ | |||
#pragma once | |||
|
|||
#ifdef HZ_PLATFORM_WINDOWS | |||
#if defined HZ_PLATFORM_WINDOWS | |||
#define HZ_DEBUG_BREAK { __debugbreak(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be cleaner to use function macros?
Suggested change
#define HZ_DEBUG_BREAK { __debugbreak(); } #define HZ_DEBUG_BREAK() __debugbreak()
Also added these changes in the assert statements
#endif | ||
|
||
#ifdef HZ_DEBUG | ||
#define HZ_ENABLE_ASSERTS | ||
#endif | ||
|
||
#ifdef HZ_ENABLE_ASSERTS | ||
#define HZ_ASSERT(x, ...) { if(!(x)) { HZ_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } } | ||
#define HZ_CORE_ASSERT(x, ...) { if(!(x)) { HZ_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } } | ||
#define HZ_ASSERT(x, ...) { if(!(x)) { HZ_ERROR("Assertion Failed: {0}", __VA_ARGS__); HZ_DEBUG_BREAK; } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define HZ_ASSERT(x, ...) { if(!(x)) { HZ_ERROR("Assertion Failed: {0}", __VA_ARGS__); HZ_DEBUG_BREAK; } } | |
#define HZ_ASSERT(x, ...) { if(!(x)) { HZ_ERROR("Assertion Failed: {0}", __VA_ARGS__); HZ_DEBUG_BREAK(); } } |
#define HZ_ASSERT(x, ...) { if(!(x)) { HZ_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } } | ||
#define HZ_CORE_ASSERT(x, ...) { if(!(x)) { HZ_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } } | ||
#define HZ_ASSERT(x, ...) { if(!(x)) { HZ_ERROR("Assertion Failed: {0}", __VA_ARGS__); HZ_DEBUG_BREAK; } } | ||
#define HZ_CORE_ASSERT(x, ...) { if(!(x)) { HZ_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); HZ_DEBUG_BREAK; } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define HZ_CORE_ASSERT(x, ...) { if(!(x)) { HZ_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); HZ_DEBUG_BREAK; } } | |
#define HZ_CORE_ASSERT(x, ...) { if(!(x)) { HZ_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); HZ_DEBUG_BREAK(); } } |
@@ -1,14 +1,16 @@ | |||
#include "hzpch.h" | |||
|
|||
// Include GLAD before GLFW, because it otherwise causes a compile error on linux | |||
#include <glad/glad.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of including it before the header file, why not move it into the header file at once; where GLFW and glad can be included next to each other?
As mensioned in the comment TheCherno/imgui#3 (comment), Hazel is currently using the docking branch. In this case, can TheCherno/imgui#4 be added to the todo list in the first post @Gaztin? |
Done |
@DaveAxiom It all depends on the PR authors. If the author of #13 (@marian-bielcik) isn't active then there's no reason to reopen it. |
@Gaztin TheCherno/imgui#4 can be checked off in the task list ^_^ |
At @DaveAxiom's request I've created new PR's (see references above this comment) in the submodules to expedite the PR's. These are final and can be merged. Once these are merged by cherno, those tasks can be ticked off. |
@cubedtear I was referring this PR to write a premake file for my repo. In addition to the links you have in the repo, I also needed to put in |
Closing since this has been picked up in #82 instead. |
I have based this PR off of #13 and updated it. This PR requires merging other two PRs in submodules, so that the libraries can be built on Linux. These are the PRs: