Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Let There Be Light 2  (Read 147650 times)

0 Members and 4 Guests are viewing this topic.

JohnGreek

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Let There Be Light 2
« Reply #45 on: March 07, 2015, 09:46:44 pm »
What flags and what executable i must use? With MinGW i just used mingw32-make on the bin folder of the project and i got it compiled. I searched a bit and found out i must provide the *.cpp files manualy?
Don't get me wrong, i don't want anybody to build it for me, i just want to learn how to do it.
Thanks :)


Edit: I got some progress but still.. Now i get undefined references to __gxx_personality and some other which means i use wrong exception handling DW/SJLJ or smth?
« Last Edit: March 07, 2015, 09:59:01 pm by JohnGreek »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
AW: Let There Be Light 2
« Reply #46 on: March 08, 2015, 05:44:52 pm »
IIRC GCC 4.9.x supports std::make_unique. Thus you should get a newer MinGW version, I can recommend the MinGW Builds which are by now part of the MinGW-w64 project.

To use C++14 features you need to add -std=c++14 to the build command.

As for your error, if you don't get exactly the same compiler as your binaries are built with, you'll have to do a clean rebuild with the new compiler (e.g. recompile SFML).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Jabberwocky

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Let There Be Light 2
« Reply #47 on: March 08, 2015, 10:01:11 pm »
I'm very happy to see you back lolz! 
Your lighting stuff is great.

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Let There Be Light 2
« Reply #48 on: April 26, 2015, 07:37:57 am »
Hello everyone,

LTBL is now almost at what I would call version 2.0! Just looking to fix some minor bugs now and improve performance. I will update the repository again with proper instructions tomorrow, stay tuned!

Antumbras now function properly alongside umbras as well now ;)

For now, here is another beauty-shot  :D


Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

DJuego

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Let There Be Light 2
« Reply #49 on: April 26, 2015, 01:57:06 pm »
Uops!! Precisely yesterday I took a  preliminary look and i tried the example: The application crashed  in the wood bridge ;D

Actually, I miss documentation   A documented API. :'(. At least, I think an exhaustive relation of features would be interesting. For example; does it cover all functionality of the original LTBL (1.5.1)? 
 
In any case, I want you to know that this news has brightened my day a lot,  8) Thanks! lolz123

DJuego

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Let There Be Light 2
« Reply #50 on: April 27, 2015, 07:42:05 am »
New version with bug fixes and instructions is up! I will work on the instructions a bit more later, they are pretty basic right now. But hopefully they are enough to get started!

Also, a demo project is on the way!
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

DJuego

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Let There Be Light 2
« Reply #51 on: April 27, 2015, 06:43:58 pm »
Ok lolz123!



**************************************************************************************
First:

(building with mingw-builds gcc 4.9.2 sjlj)

cmake -G 'MSYS Makefiles' -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_LOCAL -D SFML_ROOT=$DIRECTORIO_LOCAL ../..

[...]
-- Detecting CXX compile features - done
-- Found SFML 2.2 in v:/MinGW-Builds/mingw32/msys/local/include
CMake Error at CMakeLists.txt:14 (target_link_libraries):
  Cannot specify link libraries for target "LTBL2" which is not built by this
  project.

-----------

(building with msvc 18.0.31101.0 )

cmake -G 'NMake Makefiles' -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=$DIRECTORIO_INSTALACION_LIBRERIA -D SFML_ROOT=$DIRECTORIO_INSTALACION/SFML ../..

-- Found SFML 2.2 in w:/Archivos_de_programa/MSVC2013/x32/SFML/include
CMake Error at CMakeLists.txt:14 (target_link_libraries):
  Cannot specify link libraries for target "LTBL2" which is not built by this
  project.


------


It requires to add_library. I had to modify the CMakeLists.txt file:

set( SOURCE_PATH "${PROJECT_SOURCE_DIR}/source" )
set( SOURCES
        "${SOURCE_PATH}/ltbl/Math.h"
        "${SOURCE_PATH}/ltbl/Math.cpp" 
        "${SOURCE_PATH}/ltbl/lighting/LightDirectionEmission.cpp"
        "${SOURCE_PATH}/ltbl/lighting/LightDirectionEmission.h"
        "${SOURCE_PATH}/ltbl/lighting/LightPointEmission.cpp"
        "${SOURCE_PATH}/ltbl/lighting/LightPointEmission.h"
        "${SOURCE_PATH}/ltbl/lighting/LightShape.cpp"
        "${SOURCE_PATH}/ltbl/lighting/LightShape.h"
        "${SOURCE_PATH}/ltbl/lighting/LightSystem.cpp"
        "${SOURCE_PATH}/ltbl/lighting/LightSystem.h"
        "${SOURCE_PATH}/ltbl/quadtree/DynamicQuadtree.cpp"
        "${SOURCE_PATH}/ltbl/quadtree/DynamicQuadtree.h"
        "${SOURCE_PATH}/ltbl/quadtree/Quadtree.cpp"
        "${SOURCE_PATH}/ltbl/quadtree/Quadtree.h"
        "${SOURCE_PATH}/ltbl/quadtree/QuadtreeNode.cpp"
        "${SOURCE_PATH}/ltbl/quadtree/QuadtreeNode.h"
        "${SOURCE_PATH}/ltbl/quadtree/QuadtreeOccupant.cpp"
        "${SOURCE_PATH}/ltbl/quadtree/QuadtreeOccupant.h"
        "${SOURCE_PATH}/ltbl/quadtree/StaticQuadtree.cpp"
        "${SOURCE_PATH}/ltbl/quadtree/StaticQuadtree.h"
)

add_library( LTBL2 SHARED ${SOURCES} )
set_target_properties( LTBL2 PROPERTIES DEBUG_POSTFIX -d )

target_link_libraries(LTBL2 ${SFML_LIBRARIES})


*************************************************************************************
Second:

(building with mingw-builds gcc 4.9.2 sjlj)

[ 10%] Building CXX object CMakeFiles/LTBL2.dir/source/ltbl/Math.cpp.obj
p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/source/ltbl/Math.cpp: In fu
nction 'float ltbl::vectorMagnitude(const Vector2f&)':
p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/source/ltbl/Math.cpp:60:9:
error: 'sqrt' is not a member of 'std'
  return std::sqrt(vector.x * vector.x + vector.y * vector.y);
         ^

It requires to modify Math.cpp.

#include <cmath>

*********************************************************************************
Third:

(building with mingw-builds gcc 4.9.2 sjlj)

[ 20%] Building CXX object CMakeFiles/LTBL2.dir/source/ltbl/lighting/LightDirect
ionEmission.cpp.obj
In file included from v:/MinGW-Builds/mingw32/i686-w64-mingw32/include/c++/array
:35:0,
                 from P:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/sourc
e/ltbl/quadtree/QuadtreeOccupant.h:9,
                 from P:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/sourc
e/ltbl/lighting/LightDirectionEmission.h:4,
                 from p:/Plataformas/x32-x64/TRABAJO_MINGW_x32/LTBL2/LTBL2/sourc
e/ltbl/lighting/LightDirectionEmission.cpp:1:
v:/MinGW-Builds/mingw32/i686-w64-mingw32/include/c++/bits/c++0x_warning.h:32:2:
error: #error This file requires compiler and library support for the ISO C++ 20
11 standard. This support is currently experimental, and must be enabled with th
e -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support for the \
  ^

It requires to modify CMakeLists.txt.

# Compiler-specific flags and definitions
if(CMAKE_COMPILER_IS_GNUCXX)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")

endif()
 

*******************************************************************************
Fourth:



(building with mingw-builds gcc 4.9.2 sjlj)
(building with msvc 18.0.31101.0) <- No import libs unfortunately. :-| Will we have official solution in the future?

(SHARED libraries) - Success!!!

Thanks lolz123!



DJuego
« Last Edit: April 27, 2015, 07:06:28 pm by DJuego »

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Let There Be Light 2
« Reply #52 on: April 27, 2015, 07:13:48 pm »
Thanks DJuego!

I'll admit, I was packaging up the library in a hurry yesterday, it was 3AM   ::) (edit - err, today  ;) )

I will fix up the build!
« Last Edit: April 27, 2015, 07:16:25 pm by lolz123 »
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Let There Be Light 2
« Reply #53 on: May 03, 2015, 10:25:59 pm »
Hello!

I created a little demo for LTBL2!

Controls:
QWOP: move
Space: sprint

There is no goal, it's just a simple environment with some lighting to look at.

https://drive.google.com/file/d/0B2btNvgW7MHUQ0JfQTQ4ZndmNHc/view?usp=sharing
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Kori

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Let There Be Light 2
« Reply #54 on: July 09, 2015, 06:09:56 pm »
Does anyone here already build LTBL2 under Linux? After succesfull cmake, during "make" i have this error:

Code: [Select]
[size=10pt]Scanning dependencies of target LTBL2
[ 10%] Building CXX object CMakeFiles/LTBL2.dir/source/ltbl/Math.cpp.o
[ 20%] Building CXX object CMakeFiles/LTBL2.dir/source/ltbl/lighting/LightDirectionEmission.cpp.o
In file included from /home/lord/dev/SFM_THOR_BOX2D/LTBL2-master/LTBL2/source/ltbl/lighting/LightSystem.h:3:0,
                 from /home/lord/dev/SFM_THOR_BOX2D/LTBL2-master/LTBL2/source/ltbl/lighting/LightDirectionEmission.cpp:5:
/home/lord/dev/SFM_THOR_BOX2D/LTBL2-master/LTBL2/source/ltbl/quadtree/DynamicQuadtree.h:3:36: fatal error: ltbl/Quadtree/Quadtree.h: Nie ma takiego pliku ani katalogu  // mean no such file or directory
 #include <ltbl/Quadtree/Quadtree.h>
                                    ^
compilation terminated.
make[2]: *** [CMakeFiles/LTBL2.dir/source/ltbl/lighting/LightDirectionEmission.cpp.o] Błąd 1 // mean error1
make[1]: *** [CMakeFiles/LTBL2.dir/all] Błąd 2 // mean error 2
make: *** [all] Błąd 2 //mean error 2 [/size]



thank you in advance :)
« Last Edit: July 09, 2015, 06:58:07 pm by Kori »

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: Let There Be Light 2
« Reply #55 on: July 09, 2015, 11:53:04 pm »
Looks like a Windows "case does not matter" vs Unix "case does matter" issue to me.

Take a look at the folder name in "#include <ltbl/Quadtree/Quadtree.h>" and compare it to the folder name in ".../ltbl/quadtree/DynamicQuadtree.h:3:36". :)

(click to show/hide)

Kori

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Let There Be Light 2
« Reply #56 on: July 10, 2015, 10:18:42 am »
Thanks, but unfortunately no  :-\
But I find something interesting. My folders CMakeFiles/LTBL2.dir/source/ltbl/lighting  and  CMakeFiles/LTBL2.dir/source/ltbl/Quadtree are empty. Maybe this is the problem, now, how to fix it.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Let There Be Light 2
« Reply #57 on: July 10, 2015, 10:33:55 am »
Download the source again or if you used git, you can just go to the base directory and use git checkout ./
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Rhimlock

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Let There Be Light 2
« Reply #58 on: July 10, 2015, 10:36:26 am »
I had the same problem.

The cause was Quadtree/quadtree (case sensitive). So i changed the include-tags and everything worked.

But that was a few month ago.

Kori

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Let There Be Light 2
« Reply #59 on: July 11, 2015, 12:48:54 am »
I download the code again, then in C::B change 'Q' and 'q', solve some problems with c++14 standard, and now everything work. Thanks to all!
Ps. If anyone have any exemple code, maybe send me via priv/mail or paste here. It will be propably more helpful than "quick start" on github.