Skip to content
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

OpenGL port #6

Closed
dfranx opened this issue Aug 21, 2019 · 25 comments
Closed

OpenGL port #6

dfranx opened this issue Aug 21, 2019 · 25 comments
Labels
bug Something isn't working enhancement New feature or request opengl todo Something needs to be implemented

Comments

@dfranx
Copy link
Owner

dfranx commented Aug 21, 2019

I have just pushed a commit which includes a complete recode of the program (+ some new features ;) )

Though, there are some things that are currently broken:

  • HLSL geometry shaders
    • Not sure if this is my bug or theirs bug, or if HLSL geometry shaders now have to be coded in a specific way. A problem that I have stumbled upon is that it is quite impossible to send a variable (through output) from vertex shader to geometry shader. I think this is the issue: link but apparently it seems fixed (?).
  • MatrixReflect and MatrixShadow system variables currently do nothing and need to be reimplemented
    • glm, unlike DirectXMath, doesnt have a simple function to generate such matrices - so for now they will stay removed
  • CMake adds unnecessary parts of the glslang to the build pipeline
    • glslang-default-resource-limits, SPVRemapper, glslangValidator, spirv-remap executables are being built even though they are not used anywhere...

Please report all the bugs that you stumble upon! :D

@dfranx dfranx added bug Something isn't working enhancement New feature or request todo Something needs to be implemented opengl labels Aug 21, 2019
@dfranx
Copy link
Owner Author

dfranx commented Aug 28, 2019

Fixed CMake issue with commit ad6014b

@Houkime
Copy link

Houkime commented Aug 29, 2019

Was waiting for OpenGL and Linux for a long time.
Thx dude.
Will test it right away on my Arch box.

@dfranx
Copy link
Owner Author

dfranx commented Aug 29, 2019

No problem!
Also please reply back with your thoughts and/or if you find any issues or think something should change.

@Houkime
Copy link

Houkime commented Aug 29, 2019

It seems like SDL2 is not properly linked (or included in main.cpp)
Here is the linking part of the make output.

/usr/bin/ld: CMakeFiles/SHADERed.dir/main.cpp.o: in function `setIcon(SDL_Window*)':
main.cpp:(.text+0x185): undefined reference to `SDL_CreateRGBSurfaceWithFormatFrom'
/usr/bin/ld: main.cpp:(.text+0x26c): undefined reference to `SDL_SetWindowIcon'
/usr/bin/ld: main.cpp:(.text+0x278): undefined reference to `SDL_FreeSurface'
/usr/bin/ld: CMakeFiles/SHADERed.dir/main.cpp.o: in function `main':
main.cpp:(.text+0x738): undefined reference to `SDL_Init'
/usr/bin/ld: main.cpp:(.text+0xad6): undefined reference to `SDL_GetCurrentDisplayMode'
/usr/bin/ld: main.cpp:(.text+0xd08): undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: main.cpp:(.text+0xd17): undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: main.cpp:(.text+0xd26): undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: main.cpp:(.text+0xd35): undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: main.cpp:(.text+0xd9a): undefined reference to `SDL_CreateWindow'
/usr/bin/ld: main.cpp:(.text+0xdba): undefined reference to `SDL_SetWindowMinimumSize'
/usr/bin/ld: main.cpp:(.text+0xde1): undefined reference to `SDL_MaximizeWindow'
/usr/bin/ld: main.cpp:(.text+0xdfe): undefined reference to `SDL_SetWindowFullscreen'
/usr/bin/ld: main.cpp:(.text+0xe0d): undefined reference to `SDL_GL_CreateContext'
/usr/bin/ld: main.cpp:(.text+0xe2d): undefined reference to `SDL_GL_MakeCurrent'
/usr/bin/ld: main.cpp:(.text+0x136a): undefined reference to `SDL_PollEvent'
/usr/bin/ld: main.cpp:(.text+0x149c): undefined reference to `SDL_GetWindowFlags'
/usr/bin/ld: main.cpp:(.text+0x151b): undefined reference to `SDL_GetWindowPosition'
/usr/bin/ld: main.cpp:(.text+0x1555): undefined reference to `SDL_GetWindowSize'
/usr/bin/ld: main.cpp:(.text+0x1652): undefined reference to `SDL_GL_SwapWindow'
/usr/bin/ld: main.cpp:(.text+0x1962): undefined reference to `SDL_GL_DeleteContext'
/usr/bin/ld: main.cpp:(.text+0x1971): undefined reference to `SDL_DestroyWindow'
/usr/bin/ld: main.cpp:(.text+0x1976): undefined reference to `SDL_Quit'
/usr/bin/ld: CMakeFiles/SHADERed.dir/GUIManager.cpp.o: in function `ed::GUIManager::GUIManager(ed::InterfaceManager*, SDL_Window*, void**)':
GUIManager.cpp:(.text+0x5364): undefined reference to `SDL_GL_SetSwapInterval'
/usr/bin/ld: GUIManager.cpp:(.text+0x5aa0): undefined reference to `SDL_GetWindowDisplayIndex'
/usr/bin/ld: GUIManager.cpp:(.text+0x5ac4): undefined reference to `SDL_GetDisplayDPI'
/usr/bin/ld: CMakeFiles/SHADERed.dir/GUIManager.cpp.o: in function `ed::GUIManager::Update(float)':
GUIManager.cpp:(.text+0x72ed): undefined reference to `SDL_DestroyWindow'
/usr/bin/ld: GUIManager.cpp:(.text+0x7d6c): undefined reference to `SDL_GetWindowSize'
/usr/bin/ld: GUIManager.cpp:(.text+0x934a): undefined reference to `SDL_SetWindowTitle'
/usr/bin/ld: GUIManager.cpp:(.text+0x94e7): undefined reference to `SDL_SetWindowTitle'
/usr/bin/ld: CMakeFiles/SHADERed.dir/GUIManager.cpp.o: in function `ed::GUIManager::SaveAsProject(bool)':
GUIManager.cpp:(.text+0xafeb): undefined reference to `SDL_SetWindowTitle'
/usr/bin/ld: CMakeFiles/SHADERed.dir/GUIManager.cpp.o: in function `ed::GUIManager::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
GUIManager.cpp:(.text+0xb490): undefined reference to `SDL_SetWindowTitle'
/usr/bin/ld: CMakeFiles/SHADERed.dir/GUIManager.cpp.o: in function `ed::GUIManager::m_setupShortcuts()::{lambda()#24}::operator()() const':
GUIManager.cpp:(.text+0xc338): undefined reference to `SDL_DestroyWindow'
/usr/bin/ld: CMakeFiles/SHADERed.dir/Objects/KeyboardShortcuts.cpp.o: in function `ed::KeyboardShortcuts::Load()':
KeyboardShortcuts.cpp:(.text+0x3b4): undefined reference to `SDL_GetKeyFromName'
/usr/bin/ld: KeyboardShortcuts.cpp:(.text+0x423): undefined reference to `SDL_GetKeyFromName'
/usr/bin/ld: CMakeFiles/SHADERed.dir/Objects/KeyboardShortcuts.cpp.o: in function `ed::KeyboardShortcuts::Save()':
KeyboardShortcuts.cpp:(.text+0x816): undefined reference to `SDL_GetKeyName'
/usr/bin/ld: KeyboardShortcuts.cpp:(.text+0x85a): undefined reference to `SDL_GetKeyName'
/usr/bin/ld: CMakeFiles/SHADERed.dir/Objects/KeyboardShortcuts.cpp.o: in function `ed::KeyboardShortcuts::GetString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
KeyboardShortcuts.cpp:(.text+0x1062): undefined reference to `SDL_GetKeyName'
/usr/bin/ld: KeyboardShortcuts.cpp:(.text+0x1133): undefined reference to `SDL_GetKeyName'
/usr/bin/ld: CMakeFiles/SHADERed.dir/UI/OptionsUI.cpp.o: in function `ed::OptionsUI::m_getShortcutString[abi:cxx11]()':
OptionsUI.cpp:(.text+0x896): undefined reference to `SDL_GetKeyName'
/usr/bin/ld: CMakeFiles/SHADERed.dir/UI/OptionsUI.cpp.o:OptionsUI.cpp:(.text+0x936): more undefined references to `SDL_GetKeyName' follow
/usr/bin/ld: CMakeFiles/SHADERed.dir/UI/OptionsUI.cpp.o: in function `ed::OptionsUI::m_renderGeneral()':
OptionsUI.cpp:(.text+0xfef): undefined reference to `SDL_GL_SetSwapInterval'
/usr/bin/ld: OptionsUI.cpp:(.text+0x2059): undefined reference to `SDL_GetWindowDisplayIndex'
/usr/bin/ld: OptionsUI.cpp:(.text+0x207d): undefined reference to `SDL_GetDisplayDPI'
/usr/bin/ld: CMakeFiles/SHADERed.dir/UI/PreviewUI.cpp.o: in function `ed::PreviewUI::OnEvent(SDL_Event const&)':
PreviewUI.cpp:(.text+0xa3b): undefined reference to `SDL_CaptureMouse'
/usr/bin/ld: CMakeFiles/SHADERed.dir/UI/PreviewUI.cpp.o: in function `ed::PreviewUI::Update(float)':
PreviewUI.cpp:(.text+0x24b4): undefined reference to `SDL_CaptureMouse'
/usr/bin/ld: PreviewUI.cpp:(.text+0x24cd): undefined reference to `SDL_GetMouseState'
/usr/bin/ld: PreviewUI.cpp:(.text+0x27be): undefined reference to `SDL_GetMouseState'
/usr/bin/ld: PreviewUI.cpp:(.text+0x2946): undefined reference to `SDL_WarpMouseInWindow'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/ImGuiColorTextEdit/TextEditor.cpp.o: in function `TextEditor::HandleKeyboardInputs()':
TextEditor.cpp:(.text+0x3296): undefined reference to `SDL_GetScancodeFromKey'
/usr/bin/ld: TextEditor.cpp:(.text+0x32c4): undefined reference to `SDL_GetScancodeFromKey'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_GetClipboardText(void*)':
imgui_impl_sdl.cpp:(.text+0x23): undefined reference to `SDL_free'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x28): undefined reference to `SDL_GetClipboardText'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_SetClipboardText(void*, char const*)':
imgui_impl_sdl.cpp:(.text+0x54): undefined reference to `SDL_SetClipboardText'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_ProcessEvent(SDL_Event const*)':
imgui_impl_sdl.cpp:(.text+0x25e): undefined reference to `SDL_GetModState'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x275): undefined reference to `SDL_GetModState'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x28e): undefined reference to `SDL_GetModState'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x2a7): undefined reference to `SDL_GetModState'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x2ed): undefined reference to `SDL_GetWindowFromID'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_Init(SDL_Window*, void*)':
imgui_impl_sdl.cpp:(.text+0x4bf): undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x4d0): undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x4e1): undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x4f2): undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x503): undefined reference to `SDL_CreateSystemCursor'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o:imgui_impl_sdl.cpp:(.text+0x514): more undefined references to `SDL_CreateSystemCursor' follow
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_Shutdown()':
imgui_impl_sdl.cpp:(.text+0x62d): undefined reference to `SDL_free'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x665): undefined reference to `SDL_FreeCursor'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_UpdateMousePosAndButtons()':
imgui_impl_sdl.cpp:(.text+0x6f9): undefined reference to `SDL_WarpMouseGlobal'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x72c): undefined reference to `SDL_WarpMouseInWindow'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x76c): undefined reference to `SDL_GetMouseState'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x824): undefined reference to `SDL_GetGlobalMouseState'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x838): undefined reference to `SDL_GetKeyboardFocus'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x89b): undefined reference to `SDL_GetWindowFlags'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x8c3): undefined reference to `SDL_GetWindowPosition'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x91b): undefined reference to `SDL_CaptureMouse'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_UpdateMouseCursor()':
imgui_impl_sdl.cpp:(.text+0x977): undefined reference to `SDL_ShowCursor'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x9bf): undefined reference to `SDL_SetCursor'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x9c9): undefined reference to `SDL_ShowCursor'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_UpdateGamepads()':
imgui_impl_sdl.cpp:(.text+0xa16): undefined reference to `SDL_GameControllerOpen'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xa51): undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xa80): undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xaaf): undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xade): undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xb0d): undefined reference to `SDL_GameControllerGetButton'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o:imgui_impl_sdl.cpp:(.text+0xb3c): more undefined references to `SDL_GameControllerGetButton' follow
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_UpdateGamepads()':
imgui_impl_sdl.cpp:(.text+0xc85): undefined reference to `SDL_GameControllerGetAxis'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xd05): undefined reference to `SDL_GameControllerGetAxis'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xd85): undefined reference to `SDL_GameControllerGetAxis'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xe05): undefined reference to `SDL_GameControllerGetAxis'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_NewFrame(SDL_Window*)':
imgui_impl_sdl.cpp:(.text+0xf01): undefined reference to `SDL_GetWindowSize'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xf18): undefined reference to `SDL_GL_GetDrawableSize'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xfc1): undefined reference to `SDL_GetPerformanceFrequency'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0xfd9): undefined reference to `SDL_GetPerformanceCounter'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_CreateWindow(ImGuiViewport*)':
imgui_impl_sdl.cpp:(.text+0x113e): undefined reference to `SDL_GL_GetCurrentContext'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x1151): undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x116b): undefined reference to `SDL_GL_MakeCurrent'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x1196): undefined reference to `SDL_GetWindowFlags'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x122c): undefined reference to `SDL_CreateWindow'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x1250): undefined reference to `SDL_GL_CreateContext'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x1262): undefined reference to `SDL_GL_SetSwapInterval'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x1285): undefined reference to `SDL_GL_MakeCurrent'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_DestroyWindow(ImGuiViewport*)':
imgui_impl_sdl.cpp:(.text+0x12f8): undefined reference to `SDL_GL_DeleteContext'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x131f): undefined reference to `SDL_DestroyWindow'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_ShowWindow(ImGuiViewport*)':
imgui_impl_sdl.cpp:(.text+0x1388): undefined reference to `SDL_ShowWindow'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_GetWindowPos(ImGuiViewport*)':
imgui_impl_sdl.cpp:(.text+0x13da): undefined reference to `SDL_GetWindowPosition'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_SetWindowPos(ImGuiViewport*, ImVec2)':
imgui_impl_sdl.cpp:(.text+0x1453): undefined reference to `SDL_SetWindowPosition'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_GetWindowSize(ImGuiViewport*)':
imgui_impl_sdl.cpp:(.text+0x14a5): undefined reference to `SDL_GetWindowSize'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_SetWindowSize(ImGuiViewport*, ImVec2)':
imgui_impl_sdl.cpp:(.text+0x151e): undefined reference to `SDL_SetWindowSize'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_SetWindowTitle(ImGuiViewport*, char const*)':
imgui_impl_sdl.cpp:(.text+0x1553): undefined reference to `SDL_SetWindowTitle'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_SetWindowAlpha(ImGuiViewport*, float)':
imgui_impl_sdl.cpp:(.text+0x1589): undefined reference to `SDL_SetWindowOpacity'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_SetWindowFocus(ImGuiViewport*)':
imgui_impl_sdl.cpp:(.text+0x15b3): undefined reference to `SDL_RaiseWindow'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_GetWindowFocus(ImGuiViewport*)':
imgui_impl_sdl.cpp:(.text+0x15dd): undefined reference to `SDL_GetWindowFlags'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_GetWindowMinimized(ImGuiViewport*)':
imgui_impl_sdl.cpp:(.text+0x1610): undefined reference to `SDL_GetWindowFlags'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_RenderWindow(ImGuiViewport*, void*)':
imgui_impl_sdl.cpp:(.text+0x165d): undefined reference to `SDL_GL_MakeCurrent'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_SwapBuffers(ImGuiViewport*, void*)':
imgui_impl_sdl.cpp:(.text+0x16a3): undefined reference to `SDL_GL_MakeCurrent'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x16b2): undefined reference to `SDL_GL_SwapWindow'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_CreateVkSurface(ImGuiViewport*, unsigned long long, void const*, unsigned long long*)':
imgui_impl_sdl.cpp:(.text+0x16f3): undefined reference to `SDL_Vulkan_CreateSurface'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_UpdateMonitors()':
imgui_impl_sdl.cpp:(.text+0x173e): undefined reference to `SDL_GetNumVideoDisplays'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x1771): undefined reference to `SDL_GetDisplayBounds'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x17e4): undefined reference to `SDL_GetDisplayUsableBounds'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x1849): undefined reference to `SDL_GetDisplayDPI'
/usr/bin/ld: CMakeFiles/SHADERed.dir/libs/imgui/examples/imgui_impl_sdl.cpp.o: in function `ImGui_ImplSDL2_InitPlatformInterface(SDL_Window*, void*)':
imgui_impl_sdl.cpp:(.text+0x19c1): undefined reference to `SDL_SetHint'
/usr/bin/ld: imgui_impl_sdl.cpp:(.text+0x1a0c): undefined reference to `SDL_GetWindowID'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/SHADERed.dir/build.make:905: bin/SHADERed] Error 1
make[1]: *** [CMakeFiles/Makefile2:82: CMakeFiles/SHADERed.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I actually have previously made a small program using SDL2 but it was written in C and to find SDL2 I used pkg-config module of Cmake to do this (and it worked).
Also i need to notice that Cmake has a specialized module to handle SDL (although it is probably only SDL1).

Here is what i did in my small test program(i am not really adept at writing cmake yet)

cmake_minimum_required(VERSION 3.5)
project(sdl_test LANGUAGES C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_executable(sdl_test
  main.c
)

include(FindPkgConfig)

pkg_search_module(SDL2 REQUIRED sdl2)
target_link_libraries(sdl_test SDL2 m)

"m" is for math

@dfranx
Copy link
Owner Author

dfranx commented Aug 29, 2019

Thanks for the report! Merged your pull request! Works now, right?

@Houkime
Copy link

Houkime commented Aug 29, 2019

yep it does

image

@Houkime
Copy link

Houkime commented Aug 29, 2019

Although it seems like a FPS limiter would be nice.
When SHADERed is open i can hear chips in my PC singing (not fans)

@dfranx
Copy link
Owner Author

dfranx commented Aug 29, 2019

@Houkime there are several FPS limiters in the options:

  • 60FPS limit when not focused
  • custom FPS limit when focused (can be applied specifically to Preview window only or to whole app)
  • VSync

And there is another one that turns on automatically when SHADERed is minimized and limits the FPS to 30.

@Houkime
Copy link

Houkime commented Aug 30, 2019

Right, see that now))
Thanks.

It doesn't seem like custom FPS limiting with properties is very solid though.
I can limit things to 60 but still have bursts of around 1000-1500 and 200-400.
Considering that FPS monitor only runs at certain intervals this might as well indicate that bursts are more frequent and i am just seeing them when they come in sync with FPS monitor.
Vsync is more solid in this regard.

@dfranx
Copy link
Owner Author

dfranx commented Aug 30, 2019

Yeah, I am aware of that. Though, I don't think I can fix that. AFAIK the sleep functions aren't that precise and doing it with some kind of loop would defeat the purpose of that feature - to lower down the CPU usage.
Although, I have never noticed big jumps to 1000-1500FPS.

@meigel
Copy link

meigel commented Sep 4, 2019

Amazing that it is now available for linux! I unfortunately have some issues under Ubuntu 19.04. The binary requires libsfml-2.5 while only 2.4 is available. Maybe you could also provide a binary with statically linked libs?

../SHADERed-bin/SHADERed: error while loading shared libraries: libsfml-audio.so.2.5: cannot open shared object file: No such file or directory

Moreover, make results in an error with glm.

make
[ 6%] Built target HLSL
[ 8%] Built target OSDependent
[ 10%] Built target OGLCompiler
[ 36%] Built target glslang
[ 44%] Built target SPIRV
[ 44%] Building CXX object CMakeFiles/SHADERed.dir/Objects/FunctionVariableManager.cpp.o
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp: In static member function ‘static void ed::FunctionVariableManager::Update(ed::ShaderVariable*)’:
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:140:20: error: ‘identity’ is not a member of ‘glm’
matrix = glm::identityglm::mat4();
^~~~~~~~
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:140:20: note: suggested alternative: ‘int_t’
matrix = glm::identityglm::mat4();
^~~~~~~~
int_t
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:140:38: error: expected primary-expression before ‘>’ token
matrix = glm::identityglm::mat4();
^
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:140:40: error: expected primary-expression before ‘)’ token
matrix = glm::identityglm::mat4();
^
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:195:20: error: ‘identity’ is not a member of ‘glm’
matrix = glm::identityglm::mat4();
^~~~~~~~
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:195:20: note: suggested alternative: ‘int_t’
matrix = glm::identityglm::mat4();
^~~~~~~~
int_t
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:195:38: error: expected primary-expression before ‘>’ token
matrix = glm::identityglm::mat4();
^
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:195:40: error: expected primary-expression before ‘)’ token
matrix = glm::identityglm::mat4();
^
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:250:20: error: ‘identity’ is not a member of ‘glm’
matrix = glm::identityglm::mat4();
^~~~~~~~
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:250:20: note: suggested alternative: ‘int_t’
matrix = glm::identityglm::mat4();
^~~~~~~~
int_t
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:250:38: error: expected primary-expression before ‘>’ token
matrix = glm::identityglm::mat4();
^
/home/eigel/apps/SHADERed/Objects/FunctionVariableManager.cpp:250:40: error: expected primary-expression before ‘)’ token
matrix = glm::identityglm::mat4();
^
CMakeFiles/SHADERed.dir/build.make:278: recipe for target 'CMakeFiles/SHADERed.dir/Objects/FunctionVariableManager.cpp.o' failed
make[2]: *** [CMakeFiles/SHADERed.dir/Objects/FunctionVariableManager.cpp.o] Error 1
CMakeFiles/Makefile2:71: recipe for target 'CMakeFiles/SHADERed.dir/all' failed
make[1]: *** [CMakeFiles/SHADERed.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@dfranx
Copy link
Owner Author

dfranx commented Sep 4, 2019

Thanks for the suggestion, I will try to compile next version with statically linked libraries (although I tried before and had some problems with SFML - I will look more into it next time).

But honestly it is much easier to compile on Linux. It just takes few commands. As for your problems with make, they probably should be fixed now. Try pulling latest commit and compiling again.

@meigel
Copy link

meigel commented Sep 4, 2019

Thanks for the update! You are absolutely right that building on linux is rather simple. There unfortunately still is an issue.

[ 90%] Building CXX object CMakeFiles/SHADERed.dir/libs/pugixml/src/pugixml.cpp.o
[ 91%] Building C object CMakeFiles/SHADERed.dir/libs/nativefiledialog/nfd_gtk.c.o
[ 92%] Linking CXX executable bin/SHADERed
/usr/bin/ld: CMakeFiles/SHADERed.dir/Objects/ObjectManager.cpp.o: undefined reference to symbol '_ZNK2sf4Time9asSecondsEv'
//usr/lib/x86_64-linux-gnu/libsfml-system.so.2.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/SHADERed.dir/build.make:1507: recipe for target 'bin/SHADERed' failed
make[2]: *** [bin/SHADERed] Error 1
CMakeFiles/Makefile2:71: recipe for target 'CMakeFiles/SHADERed.dir/all' failed
make[1]: *** [CMakeFiles/SHADERed.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@dfranx
Copy link
Owner Author

dfranx commented Sep 4, 2019

Hmmm seems like I forgot to link sfml-system library
Could you try changing this line:

find_package(SFML COMPONENTS audio)

into:

find_package(SFML COMPONENTS system audio)

I'll push a commit if that actually fixes the problem.

@meigel
Copy link

meigel commented Sep 4, 2019

Same linker error I am afraid.

@dfranx
Copy link
Owner Author

dfranx commented Sep 4, 2019

Would placing a FindSFML.cmake file in the SHADERed/cmake directory work? Also sorry, I am kind of new to cmake

@dfranx
Copy link
Owner Author

dfranx commented Sep 4, 2019

Wait, before you create the FindSFML.cmake file, try adding sfml-system on this line:

# link libraries
target_link_libraries(SHADERed ${OPENGL_LIBRARIES} ${GLM_LIBRARY_DIRS} ${SDL2_MIXER_LIBRARY} ${ASSIMP_LIBRARIES} glslang SPIRV sfml-audio)

@meigel
Copy link

meigel commented Sep 4, 2019

cmake now complains about the sfml config. libsfml-dev is installed with apt and does not seem to provide cmake config files.

CMake Warning at CMakeLists.txt:125 (find_package):
By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SFML", but
CMake did not find one.

Could not find a package configuration file provided by "SFML" with any of
the following names:

SFMLConfig.cmake
sfml-config.cmake

Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
"SFML_DIR" to a directory containing one of the above files. If "SFML"
provides a separate development package or SDK, be sure it has been
installed.

@dfranx
Copy link
Owner Author

dfranx commented Sep 4, 2019

Oh right, I think the config file was introduced in the 2.5 version. I've just pushed a commit that includes FindSFML.cmake . Pull those changes and then try to compile...

@meigel
Copy link

meigel commented Sep 4, 2019

This works! All fine now. Cheers!

@dfranx
Copy link
Owner Author

dfranx commented Sep 4, 2019

Glad that it works now! Hopefully SHADERed also works properly. If a bug occurs please feel free to report it!

@dfranx
Copy link
Owner Author

dfranx commented Sep 4, 2019

I've changed it up a bit (since now it doesn't compile on my machine...)

If someone doesn't have SFML 2.5 installed, they should define the USE_FINDSFML variable:

cmake -DUSE_FINDSFML=ON .

Otherwise, just run

cmake .

AlvaroRuizDelgado added a commit to AlvaroRuizDelgado/SHADERed that referenced this issue Dec 21, 2019
* Cross platform update

* Minor CMake changes

* Use inotify for file watcing on linux

* Fix for dfranx#5

* Fix GLSL shaders + fix for a bug that occurs when using multiple textures

* Add steps for Windows in the README

* Add FindGLM.cmake

* Variable pointers

* Small fix for variable pointers

* Shader macros

* fix sdl linking on Linux

* Update CHANGELOG

* Fix for dfranx#13

* Add FrameIndex system variable dfranx#14

* Add option that disables RT clear dfranx#15

* UIHelper -> include clocale

* Shader variable flags dfranx#12

* Fix CopyState() crash

* Fix last frame flag for GeometryTransform dfranx#12

* Disable last frame for IsPicked + change var manager default size

* Icons

* Add format property to render textures dfranx#17

* Add toolbar

* Add elapsed time to status bar + make the toolbar buttons work

* Pause and increase time

* Fix float4/int4/bool4 variables

* Add Mouse and MouseButton system variables

* Zoom in/out functionality

* Zoom controls

* Fix RT filtering and model rendering

* Fix a bug where SHADERed would crash with multiple 3D models dfranx#18

* Replace glm::identity<glm::mat4>() with glm::mat4(1) dfranx#6

* Add option to reset time

* Fix zoom area dragging & limit zoom selection bounds

* Add CTRL+ALT+MWheel to zoom in/out

* Add FindSFML.cmake

* Add USE_FINDSFML variable

* Add cubemap preview

* Fix picking when zoomed in

* Improve gizmo, bounding box & zoom area performance

* Add option to modify system variables when rendering to an image

* macOS changes

* Object preview window

* Fix CMakeLists.txt

* Add proper cubemap and audio preview to the object preview window

* Add buffers

* Add instancing

* Add ability to use buffers as inputs for instanced objects

* Fix 3D model instancing

* Make it compilable on windows

* Add auto check for updates on startup

* Add buffer to toolbar & minor improvements to UpdateChecker

* Update TextEditor dfranx#19

* Add show whitespace option

* Update external libraries

* Add auto recompile option - compile changed shaders every 200ms

* Add option to disable window's alpha channel

* Add ScreenQuadNDC

* Add the ability to set CodeUI.Save and Project.Save to same shortcut

* Add option to stream logs to file

* Bump version

* Fix loading files from different drives on Windows dfranx#18

* Add ImageObject

* Add compute shaders

* Compute shader examples + fixes

* Minor changes

* Update README.md & TUTORIAL.md

* Fix README gif

* Remove some gifs

* Fix crash on RWTexture2D

* Fix crash on HLSL function calls with no arguments (update glslang)

* Fix various transcompiler crashes

* Various TextEditor fixes (check CHANGELOG) - update ImGuiColorTextEdit submodule

* Fix a bug that occurs when fetching texel data from a texture without a sampler

* Write item type in the properties

* Use different color to write shader pass with an error in the PipelineUI

* Disable various path textboxes

* Prevent pause button from overlapping

* Update TextEditor, add hlsl compute example, bump version

* Add Vulkan GLSL support dfranx#21

* Minor fixes

* Add input layout (dfranx#25)

* Exporting/importing shader pass input layout

* Add input layout manager

* Fix tangents and bitangents

* Add option to export a sequence of images dfranx#23

* Improve performance mode dfranx#24

* Various fixes & changes

* Add CameraPosition3 and CameraDirection3 variables

* Add drag & drop

* Add 'Are you sure?' message box

* Multiple bug fixes

* Rework ImageObject & fix ScreenQuadNDC rendering

* Add resource manager

* Add CTRL+F/search box in the text editor

* Fix for dfranx#27

* Fix a bug where SHADERed would recompile file two times after clicking Compile button

* Add ability to change variable type after variable has been created

* Add a window where all system variables are listed

* Add magnifier tool to object preview window

* Make it so that any form of project save also saves all shader code modifications

* Shader code modifications now also count as project modifications

* Minor changes

* Add context menu and replace feature in the text editor & fix copy and paste functionalities

* Some internal changes to the magnifier tool in ObjectPreviewUI

* Detect if some Editor shortcuts are missing

* Remove all the maps from ObjectManager

* Fix for gcc

* Fixes

* Add support for HLSL types in the buffer format

* Recompile shader pass after we change it's shader path

* Add ability to change warning, message and error text colors in the theme files

* CodeEditorUI now holds pointers to PipelineItems

* Close code editors after a shader pass has been deleted

* Add feature that automatically creates variables when creating a shader pass

* Add Editor.FindNext & improve text editor find feature

* Add 3D textures

* Add Project -> Options

* Fix 3D textures

* Fix texture loading

* Add various checks to prevent crashes

* Add multi-camera system (+ ShadowMapping example) & fix matrix variable export/import

* Update readme

* Add audio shaders (+ audioshader example)

* Update libraries

* Update TODO.md

* Fix a bug where openning Sobel -> Edge -> Sobel examples would break the rendered

* Fix a crash on openning 'cubemap' example

* Update README.md & settings.ini

* Improve image sequence export speed & add ability to use sprintf format specifiers in filename (dfranx#23)

* Add Fedora Dependencies

* Scroll to the selection & fix FindNext highlighting

* Update TODO.md

* Fix Editor.Find and Editor.Replace shortcuts

* Fix HOME/END shortcuts

* Fix gizmo interaction when preview is zoomed in

* Add drag & drop to PipelineUI

* Bump version

* Add ability to deactivate certain shader pass

* Pausing preview now also pauses compute shaders

* Improve TextEditor shortcuts

* Revert

* Update TODO.md & CHANGELOG.txt

* Fix a bug where TextEditor would lose focus on ALT key press

* Plugin API base

* Fixed missed return ArcBallCamera '=' operator

* Fixed missed return value for '=' operator

* Memory leak fix

```
		if (m_item.Data != nullptr)
			delete m_item.Data;
```
m_item.Data:
https://github.com/dfranx/SHADERed/blob/24ba95faebfde61581a08792b82f5ad2cb13d69f/Objects/PipelineItem.h#L45

it leads to mem leak as 'delete' operator can't delete 'void*' proper. (not type information -> not size data, and no information about destructor, ... )
https://github.com/dfranx/SHADERed/blob/24ba95faebfde61581a08792b82f5ad2cb13d69f/Objects/PipelineItem.h#L45
i.e. destructors of internal fields (ex https://github.com/dfranx/SHADERed/blob/24ba95faebfde61581a08792b82f5ad2cb13d69f/Objects/PipelineItem.h#L78)  won't be executed.

* Mem-leak fix

Base class should have a virtual destructor otherwise delete (UIView*) ... won't be able to call derived destructor (even a default one).

* Add support for #include

* Update TODO.md & minor changes to KeyboardShortcuts (dfranx#35)

* Fix #include's for HLSL

* Fix message line numbers when using #include in GLSL shaders

* Add 'Recursive #include detected' message

* Update default theme & font (dfranx#9)

* Add an option to save supersampled screenshots (dfranx#34)

* Update imgui

* Add search in Options -> Shortcuts

* Bump version

* Add ability to load projects by drag and dropping them

* Toolbar item for openning projects should now also show 'Are you sure?' message box

* Somewhat fix autocomplete and find window background colors

* Update and expand the API

* Hide object view window in performance mode

* Add MSAA (dfranx#36)

* Change how MouseButton works

* Fix a bug where user could select same RT multiple times for the same pass

* Fix camera rotation loading from project file

* Add ability to add custom system variable types

* Check if user doesn't have required plugins for a project

* Add ability to disable certain plugins

* Consistency between auto-recompile and normal recompile when using #include

* Add ability to add custom functions

* Add ability to install SHADERed binaries (dfranx#33)

* make install -> lowercase (dfranx#33)

* Compiles on linux

* Plugins can now add custom ObjectManager items

* Add PipelineItem::PluginItem

* Fixes, improvements & add various plugin functions

* Add GetPluginVersion() & fix bugs

* More fixes

* Update shortcuts.kb

* Add ShowContextItems(pluginitem_add, item_type)

* Add GetDPI, Log, FileExists, ClearMessageGroup to plugin API

* Add GetObjectCount, GetObjectName, IsTexture, GetTexture, GetTextureSize plugin functions + fix pipelineitem_add

* Add XDG desktop and AppData files for Linux integration

This also installs those files in CMake to expose SHADERed
to the application launcher once installed.

* Add BeginRender and EndRender to PluginAPI

* Prevent SHADERed from crashing when plugins directory doesn't exist (dfranx#38)

* Cache PluginItems in RenderEngine

* Add BindDefaultStateFn

* Add ability to check for changes in plugin's custom files

* Plugin API can now access CodeEditorUI features

* Auto recompile now works with plugin items

* Plugin API changes

* Prevent crashes when one of the directories (themes, templates, data) doesn't exist

* Create data directory if it doesn't exist

* Update plugin API

Co-authored-by: Franx <dfranx00@gmail.com>
Co-authored-by: CuriousTommy <CuriousTommy@users.noreply.github.com>
Co-authored-by: Denis <denis.ovod@gmail.com>
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
@Calinou
Copy link
Contributor

Calinou commented Feb 27, 2020

Should this issue be closed now?

@dfranx
Copy link
Owner Author

dfranx commented Feb 27, 2020

Hmm... I don't know, I've opened this issue mostly because I wasn't getting the right output from glslang when transcompiling a HLSL shader. But I haven't fixed that yet. Though, I will try my best to fix it in one of the upcoming updates.
As for the MatrixReflect and MatrixShadow, I guess I will remove/implement them now.

But yeah, not sure.. I might leave this open until I fix HLSL geometry shaders?

@dfranx
Copy link
Owner Author

dfranx commented May 18, 2020

I've just seen that KhronosGroup/glslang#1660 has been fixed. I guess I can finally close this issue as HLSL geometry shaders work again in SHADERed!
HLSLGeometryShaders

@dfranx dfranx closed this as completed May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request opengl todo Something needs to be implemented
Projects
None yet
Development

No branches or pull requests

4 participants