dalerank / nanogui-sdl

Minimalistic port of NanoGUI claim works with SDL API w/o external dependencies.
Other
437 stars 77 forks source link

Status? #27

Closed AregevDev closed 5 years ago

AregevDev commented 5 years ago

Hi, I really appreciate this fork of nanogui. I prefer using SDL for my OpenGL development and this library is absolutely beautiful and suit my needs.

Is this fork still active? There is a commit from yesterday after a few years of inactivity...

Also, I tried to build it today from source, on Windows. It generally has many problems:

Please keep the hard work! Much appreciated. I will happily contribute to this project.

Best regards Alon

dalerank commented 5 years ago

In develop, hope I have time now to support it I used cmake that create solution for vs Now it using nanort render, instead of opengl render, because SDL compatibility need Will fix readme with build instructions

dalerank commented 5 years ago

clone repo $mkdir build $cd build & cmake .. open solution in vs sory just may test in on windows 10 only yet

AregevDev commented 5 years ago

Thanks for replying, Which SDL version should I use when building? Does it support SDL 2.0.9?

dalerank commented 5 years ago

Yep, just downloaded stable from libsdl.org, seems it need again update install instructions for win

AregevDev commented 5 years ago

I am getting build errors when building the generated solution https://pastebin.com/D2X2YTPH Mind taking a look?

I am using SDL 2.0.9

dalerank commented 5 years ago

what '$build cmake ..' say?

AregevDev commented 5 years ago
PS E:\source\nanogui-sdl\build> $build cmake ..
At line:1 char:8
+ $build cmake ..
+        ~~~~~
Unexpected token 'cmake' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken
dalerank commented 5 years ago

ouch.... $build cmake .. means run 'cmake ..' from folder build

AregevDev commented 5 years ago

That's what I do, it configured alright, but it fails to build

I use this configure command to detect the libraries:

cmake -DSDL2_LIBRARY="../../libs/x64-windows-static/lib" -DSDL2_INCLUDE_DIR="../../libs/x64-windows-static/include" -DSDL2TTF_LIBRARY="../../libs/x64-windows-static/lib" -DSDL2TTF_INCLUDE_DIR="../../libs/x64-windows-static/include" -DSDL2_IMAGE_LIBRARY="../../libs/x64-windows-static/lib" -DSDL2_IMAGE_INCLUDE_DIR="../../libs/x64-windows-static/include" ..
dalerank commented 5 years ago

will try you cmd line possible you need removed content from build folder and run your command again, because cmake may cached some variables? on my pc output was,

$build cmake ..
SDL2_INCLUDE_DIR is D:/SDL2/include
SDL2_LIBRARY_PATH is D:/SDL2/lib/x86/SDL2.lib
SDL2IMAGE_LIBRARY is D:/SDL2/lib/x86/SDL2_image.lib
SDL2TTF_LIBRARY is D:/SDL2/lib/x86/SDL2_ttf.lib
-- Configuring done
-- Generating done
-- Build files have been written to: D:/nanogui-sdl/build
dalerank commented 5 years ago
d:\nanogui-sdl\build>cmake -DSDL2_LIBRARY="D:/sdl2/xb86/sdl2.lib" -DSDL2_INCLUDE_DIR="d:/sdl2/include" -DSDL2TTF_LIBRARY="d:/sdl2/lib/x86/sdl2_ttf.lib" -DSDL2TTF_INCLUDE_DIR="d:/sdl2/include" -DSDL2_IMAGE_LIBRARY="d:/sdl2/lib/x86/sdl2_image.lib" SDL2_IMAGE_INCLUDE_DIR="d:/sdl2/include" ..
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version  to target Windows 10.0.18362.
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
SDL2_INCLUDE_DIR is D:/SDL2/include
SDL2_LIBRARY_PATH is D:/SDL2/lib/x86/SDL2.lib
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found SDL2: D:/sdl2/xb86/sdl2.lib
-- Found SDL2_image: D:/SDL2/lib/x86/SDL2_image.lib
SDL2IMAGE_LIBRARY is D:/SDL2/lib/x86/SDL2_image.lib
SDL2TTF_LIBRARY is d:/sdl2/lib/x86/sdl2_ttf.lib
-- Found SDL2TTF: d:/sdl2/lib/x86/sdl2_ttf.lib
opengl32
-- Configuring done
-- Generating done
-- Build files have been written to: D:/nanogui-sdl/build
AregevDev commented 5 years ago

What's you output when you build: IE cmake --build .?

I deleted my build folder's contents, reconfigured again, it comes up with the same build errors

dalerank commented 5 years ago
d:\nanogui-sdl\build>cmake -DSDL2_LIBRARY="D:/sdl2/lib/x86/sdl2.lib" -DSDL2_INCLUDE_DIR="d:/sdl2/include" -DSDL2TTF_LIBRARY="d:/sdl2/lib/x86/sdl2_ttf.lib" -DSDL2TTF_INCLUDE_DIR="d:/sdl2/include" -DSDL2_IMAGE_LIBRARY="d:/sdl2/lib/x86/sdl2_image.lib" SDL2_IMAGE_INCLUDE_DIR="d:/sdl2/include" ..
-- Selecting Windows SDK version  to target Windows 10.0.18362.
SDL2_INCLUDE_DIR is D:/SDL2/include
SDL2_LIBRARY_PATH is D:/SDL2/lib/x86/SDL2.lib
-- Found SDL2: D:/sdl2/lib/x86/sdl2.lib
SDL2IMAGE_LIBRARY is D:/SDL2/lib/x86/SDL2_image.lib
SDL2TTF_LIBRARY is d:/sdl2/lib/x86/sdl2_ttf.lib
opengl32
-- Configuring done
-- Generating done
-- Build files have been written to: D:/nanogui-sdl/build

d:\nanogui-sdl\build>cmake --build .
Microsoft (R) Build Engine версии 14.0.27530.0

  example1.vcxproj -> D:\nanogui-sdl\build\Debug\example1.exe
  example1.vcxproj -> D:/nanogui-sdl/build/Debug/example1.pdb (Full PDB)
  Building Custom Rule D:/nanogui-sdl/CMakeLists.txt

d:\nanogui-sdl\build>
AregevDev commented 5 years ago

Which SDL version do you use, that's so strange for me...

AregevDev commented 5 years ago

Does nanogui-sdl depend on something, other than SDL, SDL image and SDL ttf?

dalerank commented 5 years ago

No other depends

AregevDev commented 5 years ago

Which SDL version do you use, that's so strange for me...

And the version?

dalerank commented 5 years ago

Last stable from libsdl.org 2.0.10

AregevDev commented 5 years ago

I rebuilt 2.0.10 this time, same errors. They are about undefined references SDL_FRect SDL_FPoint SDL_RenderFillRectF Do you know where they are from?

dalerank commented 5 years ago

It sdl2 structs

AregevDev commented 5 years ago

Are you sure? image Does not seem like that

dalerank commented 5 years ago

sure, official sdl repo http://hg.libsdl.org/SDL/file/bc90ce38f1e2/include/SDL_rect.h look at line 88

created travis-ci for test building on windows it downloads stable sdl2 stuff from libsdl.org and unpack it after that build no errors

https://travis-ci.org/dalerank/nanogui-sdl/builds/582167397

dalerank commented 5 years ago

try now

dalerank commented 5 years ago

fixed