Hello! I am trying to get started with this. I downloaded the latest release from
http://sourceforge.net/projects/letthebelight/files/ and added the source folder to my include path. But when I try to write a simple code to test:
#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <LTBL/Light/LightSystem.h>
#include <LTBL/Light/Light.h>
#include <LTBL/Constructs/AABB.h>
#include <iostream>
#include <assert.h>
using namespace std;
int main() {
sf::VideoMode vidMode;
vidMode.width = 800;
vidMode.height = 600;
vidMode.bitsPerPixel = 32;
assert(vidMode.isValid());
sf::RenderWindow mWindow(vidMode, "Prueba Light");
// Light System
ltbl::LightSystem ls(AABB(Vec2f(0.0f, 0.0f),
Vec2f(static_cast<float>(vidMode.width), static_cast<float>(vidMode.height))), &mWindow,
"lightFin.png", "lightAttenuationShader.frag");
// Create a light
ltbl::Light_Point* testLight = new ltbl::Light_Point();
testLight->m_center = Vec2f(200.0f, 200.0f);
testLight->m_radius = 500.0f;
testLight->m_size = 30.0f;
testLight->m_spreadAngle = 2.0f * static_cast<float>(3.14159265);
testLight->m_softSpreadAngle = 0.0f;
testLight->CalculateAABB();
lightSystem.AddLight(testLight);
while(mWindow.isOpen()){
sf::Event mEvent;
while (mWindow.pollEvent(mEvent)){
if (mEvent.type == sf::Event::Closed ||
((mEvent.type == sf::Event::KeyPressed) && (mEvent.key.code == sf::Keyboard::Escape))){
mWindow.close();
}
}
mWindow.clear();
mWindow.display();
}
return 0;
}
In the line:
ltbl::Light* testLight = new ltbl::Light();
I get the error:
The type 'ltbl::Light' must implement the inherited pure virtual method 'ltbl::Light::RenderLightSolidPortion'
I don't know if I have to compile it and add libraries like in SFML I haven't found anything, so I tried building with cmake with this git repository:
https://github.com/hovatterz/lightI am on Ubuntu 12.04 so installed boost with:
sudo apt-get install libboost-all-dev
Then cmake . and then when I do make i get an error, here is what I get in the console:
andres@Andres-NT:~/Dropbox/Development/light$ cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.53.0
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
Found SFML: /usr/local/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/andres/Dropbox/Development/light
andres@Andres-NT:~/Dropbox/Development/light$ make
Scanning dependencies of target ltbl
[ 9%] Building CXX object CMakeFiles/ltbl.dir/src/Constructs.o
[ 18%] Building CXX object CMakeFiles/ltbl.dir/src/ConvexHull.o
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:4:0,
from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14,
from /home/andres/Dropbox/Development/light/include/LTBL/ConvexHull.h:6,
from /home/andres/Dropbox/Development/light/src/ConvexHull.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeOccupant.h:39:17: warning: class ‘qdt::AABB’ is implicitly friends with itself [enabled by default]
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14:0,
from /home/andres/Dropbox/Development/light/include/LTBL/ConvexHull.h:6,
from /home/andres/Dropbox/Development/light/src/ConvexHull.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:55:16: warning: class ‘qdt::QuadTreeNode’ is implicitly friends with itself [enabled by default]
[ 27%] Building CXX object CMakeFiles/ltbl.dir/src/Light.o
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:4:0,
from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14,
from /home/andres/Dropbox/Development/light/include/LTBL/Light.h:6,
from /home/andres/Dropbox/Development/light/src/Light.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeOccupant.h:39:17: warning: class ‘qdt::AABB’ is implicitly friends with itself [enabled by default]
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14:0,
from /home/andres/Dropbox/Development/light/include/LTBL/Light.h:6,
from /home/andres/Dropbox/Development/light/src/Light.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:55:16: warning: class ‘qdt::QuadTreeNode’ is implicitly friends with itself [enabled by default]
[ 36%] Building CXX object CMakeFiles/ltbl.dir/src/LightSystem.o
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:4:0,
from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14,
from /home/andres/Dropbox/Development/light/include/LTBL/Light.h:6,
from /home/andres/Dropbox/Development/light/include/LTBL/LightSystem.h:4,
from /home/andres/Dropbox/Development/light/src/LightSystem.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeOccupant.h:39:17: warning: class ‘qdt::AABB’ is implicitly friends with itself [enabled by default]
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14:0,
from /home/andres/Dropbox/Development/light/include/LTBL/Light.h:6,
from /home/andres/Dropbox/Development/light/include/LTBL/LightSystem.h:4,
from /home/andres/Dropbox/Development/light/src/LightSystem.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:55:16: warning: class ‘qdt::QuadTreeNode’ is implicitly friends with itself [enabled by default]
[ 45%] Building CXX object CMakeFiles/ltbl.dir/src/Light_Beam.o
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:4:0,
from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14,
from /home/andres/Dropbox/Development/light/include/LTBL/Light.h:6,
from /home/andres/Dropbox/Development/light/include/LTBL/Light_Beam.h:4,
from /home/andres/Dropbox/Development/light/src/Light_Beam.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeOccupant.h:39:17: warning: class ‘qdt::AABB’ is implicitly friends with itself [enabled by default]
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14:0,
from /home/andres/Dropbox/Development/light/include/LTBL/Light.h:6,
from /home/andres/Dropbox/Development/light/include/LTBL/Light_Beam.h:4,
from /home/andres/Dropbox/Development/light/src/Light_Beam.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:55:16: warning: class ‘qdt::QuadTreeNode’ is implicitly friends with itself [enabled by default]
[ 54%] Building CXX object CMakeFiles/ltbl.dir/src/QuadTree.o
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:4:0,
from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14,
from /home/andres/Dropbox/Development/light/src/QuadTree.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeOccupant.h:39:17: warning: class ‘qdt::AABB’ is implicitly friends with itself [enabled by default]
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14:0,
from /home/andres/Dropbox/Development/light/src/QuadTree.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:55:16: warning: class ‘qdt::QuadTreeNode’ is implicitly friends with itself [enabled by default]
[ 63%] Building CXX object CMakeFiles/ltbl.dir/src/QuadTreeNode.o
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:4:0,
from /home/andres/Dropbox/Development/light/src/QuadTreeNode.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeOccupant.h:39:17: warning: class ‘qdt::AABB’ is implicitly friends with itself [enabled by default]
In file included from /home/andres/Dropbox/Development/light/src/QuadTreeNode.cpp:1:0:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:55:16: warning: class ‘qdt::QuadTreeNode’ is implicitly friends with itself [enabled by default]
[ 72%] Building CXX object CMakeFiles/ltbl.dir/src/QuadTreeOccupant.o
In file included from /home/andres/Dropbox/Development/light/src/QuadTreeOccupant.cpp:1:0:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeOccupant.h:39:17: warning: class ‘qdt::AABB’ is implicitly friends with itself [enabled by default]
In file included from /home/andres/Dropbox/Development/light/src/QuadTreeOccupant.cpp:3:0:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:55:16: warning: class ‘qdt::QuadTreeNode’ is implicitly friends with itself [enabled by default]
[ 81%] Building CXX object CMakeFiles/ltbl.dir/src/SFML_OpenGL.o
[ 90%] Building CXX object CMakeFiles/ltbl.dir/src/ShadowFin.o
Linking CXX shared library lib/libltbl.so
[ 90%] Built target ltbl
[100%] Building CXX object bin/CMakeFiles/sample.dir/main.o
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:4:0,
from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14,
from /home/andres/Dropbox/Development/light/include/LTBL/Light.h:6,
from /home/andres/Dropbox/Development/light/include/LTBL/LightSystem.h:4,
from /home/andres/Dropbox/Development/light/sample/main.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeOccupant.h:39:17: warning: class ‘qdt::AABB’ is implicitly friends with itself [enabled by default]
In file included from /home/andres/Dropbox/Development/light/include/LTBL/QuadTree.h:14:0,
from /home/andres/Dropbox/Development/light/include/LTBL/Light.h:6,
from /home/andres/Dropbox/Development/light/include/LTBL/LightSystem.h:4,
from /home/andres/Dropbox/Development/light/sample/main.cpp:1:
/home/andres/Dropbox/Development/light/include/LTBL/QuadTreeNode.h:55:16: warning: class ‘qdt::QuadTreeNode’ is implicitly friends with itself [enabled by default]
/home/andres/Dropbox/Development/light/sample/main.cpp: In function ‘int main(int, char**)’:
/home/andres/Dropbox/Development/light/sample/main.cpp:144:51: error: ‘snprintf’ was not declared in this scope
make[2]: *** [bin/CMakeFiles/sample.dir/main.o] Error 1
make[1]: *** [bin/CMakeFiles/sample.dir/all] Error 2
make: *** [all] Error 2
Hope you can help me