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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dragondgold

Pages: [1]
1
SFML projects / Re: SFML Light System - Let There Be Light
« on: May 15, 2013, 04:50:44 am »
You have to #include <LTBL/Light/Light_Point.h>

Almost the same error  :-\

make all
Building file: ../src/PruebaLightSFML.cpp
Invoking: GCC C++ Compiler
g++ -I/home/andres/Dropbox/Development/SFML-2.0/include -I/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -MMD -MP -MF"src/PruebaLightSFML.d" -MT"src/PruebaLightSFML.d" -o "src/PruebaLightSFML.o" "../src/PruebaLightSFML.cpp"
In file included from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Constructs.h:5:0,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/Light.h:29,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/Light_Point.h:25,
                 from ../src/PruebaLightSFML.cpp:7:
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Constructs/AABB.h:54:15: warning: class &#8216;AABB&#8217; is implicitly friends with itself [enabled by default]
Finished building: ../src/PruebaLightSFML.cpp
 
Building target: PruebaLightSFML
Invoking: GCC C++ Linker
g++ -L/home/andres/Dropbox/Development/SFML-2.0/lib -o "PruebaLightSFML"  ./src/PruebaLightSFML.o   -lthor -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system
./src/PruebaLightSFML.o: In function `main':
/home/andres/Dropbox/workspace/PruebaLightSFML/Debug/../src/PruebaLightSFML.cpp:31: undefined reference to `ltbl::Light_Point::Light_Point()'
/home/andres/Dropbox/workspace/PruebaLightSFML/Debug/../src/PruebaLightSFML.cpp:32: undefined reference to `Vec2f::Vec2f(float, float)'
collect2: ld returned 1 exit status
make: *** [PruebaLightSFML] Error 1

PD: Also I have the same errors with LightSystem, seems like nothing of ltbl is working. I will try creating a new Eclipse project tomorrow.

2
SFML projects / Re: SFML Light System - Let There Be Light
« on: May 15, 2013, 03:47:55 am »
LTBL needs C++11 in order to compile. Try compiling it again with C++11 features enabled.

I get this errors compiling with C++11

make all
Building file: ../src/PruebaLightSFML.cpp
Invoking: GCC C++ Compiler
g++ -I/home/andres/Dropbox/Development/SFML-2.0/include -I/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -MMD -MP -MF"src/PruebaLightSFML.d" -MT"src/PruebaLightSFML.d" -o "src/PruebaLightSFML.o" "../src/PruebaLightSFML.cpp"
In file included from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:4:0,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTree.h:4,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/StaticQuadTree.h:4,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/LightSystem.h:30,
                 from ../src/PruebaLightSFML.cpp:7:
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Constructs/AABB.h:54:15: warning: class ‘AABB’ is implicitly friends with itself [enabled by default]
../src/PruebaLightSFML.cpp: In function ‘int main()’:
../src/PruebaLightSFML.cpp:29:2: error: ‘Light_Point’ was not declared in this scope
../src/PruebaLightSFML.cpp:29:15: error: ‘testLight’ was not declared in this scope
../src/PruebaLightSFML.cpp:29:31: error: expected type-specifier before ‘Light_Point’
../src/PruebaLightSFML.cpp:29:31: error: expected ‘;’ before ‘Light_Point’
make: *** [src/PruebaLightSFML.o] Error 1

3
SFML projects / Re: SFML Light System - Let There Be Light
« on: May 15, 2013, 03:31:21 am »
ltbl::Light* testLight = new ltbl::Light();

As far as I can tell, this isn't in the code sample you posted. ltbl::Light is a base class only, and cannot be instantiated by itself. Use ltbl::Light_Point to create a point light.

Sorry, yeah, I am getting this error using Light() as the PDF in v1.5.1 says. I changed it to use Light_Point and after adding some includes and deleting -std=c++0x flag from my compiler some errors have dissapeared but I still get this errors:

make all
Building file: ../src/PruebaLightSFML.cpp
Invoking: GCC C++ Compiler
g++ -I/home/andres/Dropbox/Development/SFML-2.0/include -I/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/PruebaLightSFML.d" -MT"src/PruebaLightSFML.d" -o "src/PruebaLightSFML.o" "../src/PruebaLightSFML.cpp"
In file included from /usr/include/c++/4.6/unordered_set:35:0,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:9,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTree.h:4,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/StaticQuadTree.h:4,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/LightSystem.h:30,
                 from ../src/PruebaLightSFML.cpp:7:
/usr/include/c++/4.6/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
In file included from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:4:0,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTree.h:4,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/StaticQuadTree.h:4,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/LightSystem.h:30,
                 from ../src/PruebaLightSFML.cpp:7:
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Constructs/AABB.h:54:15: warning: class ‘AABB’ is implicitly friends with itself [enabled by default]
In file included from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTree.h:4:0,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/StaticQuadTree.h:4,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/LightSystem.h:30,
                 from ../src/PruebaLightSFML.cpp:7:
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:21:39: warning: ‘>>’ operator will be treated as two right angle brackets in C++0x [-Wc++0x-compat]
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:21:39: note: suggest parentheses around ‘>>’ expression
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:21:43: error: ‘m_children’ was not declared in this scope
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:21:43: error: ‘*’ cannot appear in a constant-expression
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:21:39: error: ‘>>’ should be ‘> >’ within a nested template argument list
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:24:3: error: ‘unordered_set’ in namespace ‘std’ does not name a type
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:41:26: error: ‘std::unordered_set’ has not been declared
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTreeNode.h:41:39: error: expected ‘,’ or ‘...’ before ‘<’ token
In file included from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/StaticQuadTree.h:4:0,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/LightSystem.h:30,
                 from ../src/PruebaLightSFML.cpp:7:
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTree.h:16:3: error: ‘unordered_set’ in namespace ‘std’ does not name a type
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/QuadTree/QuadTree.h:18:3: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
In file included from ../src/PruebaLightSFML.cpp:7:0:
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/LightSystem.h:47:3: error: ‘unordered_set’ in namespace ‘std’ does not name a type
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/LightSystem.h:49:3: error: ‘unordered_set’ in namespace ‘std’ does not name a type
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/LightSystem.h:51:3: error: ‘unordered_set’ in namespace ‘std’ does not name a type
make: *** [src/PruebaLightSFML.o] Error 1

And this is my code:

#include <iostream>
#include <cmath>
#include <assert.h>
#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <LTBL/Light/LightSystem.h>

using namespace std;
using namespace ltbl;

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
        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
        Light_Point* testLight = new 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>(M_PI);
        testLight->m_softSpreadAngle = 0.0f;
        testLight->CalculateAABB();
        ls.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;
}
 

4
SFML projects / Re: SFML Light System - Let There Be Light
« on: May 14, 2013, 04:48:40 pm »
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/light
I 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  :)

5
Graphics / Re: ViewPort not working correctly?
« on: May 13, 2013, 04:21:12 pm »
I feel stupid :P The problem was the position thank you guys!!

6
Graphics / ViewPort not working correctly?
« on: May 11, 2013, 07:04:05 pm »
Hello, I am trying to display a full screen image using Views. This is my code:

       sf::RenderWindow mWindow(sf::VideoMode(800,600), "Prueba Animaciones");

        // Cargo la imagen y muestro un pedazo
        sf::Texture mBGTexture;
        sf::Sprite mBGSprite;
        if(!mBGTexture.loadFromFile("bg_big.png")) return EXIT_FAILURE;
        mBGSprite.setTexture(mBGTexture);

        imageWidth = mBGTexture.getSize().x;
        imageHeight = mBGTexture.getSize().y;

        sf::CircleShape mBall;
        mBall.setRadius(10.0);
        mBall.setFillColor(sf::Color::White);

        sf::View miniMap;
        miniMap.setSize(imageWidth, imageHeight);
        miniMap.setViewport(sf::FloatRect(0, 0, 1, 1));

        mWindow.setFramerateLimit(60);

        while(mWindow.isOpen()){
                mWindow.clear();
                mWindow.setView(miniMap);
                mWindow.draw(mBGSprite);
                mWindow.draw(mBall);

                mWindow.display();
        }

The result is this: http://db.tt/14sjmZol. As you can see it is not using the full screen and my image is cutted on right (this is the original image: http://db.tt/5Q6D3uN5). Why this happens? Isn't it suppose to show me the full image on the window ?

7
Graphics / Re: SFML 2.0 crappy graphics on Intel GMA3150
« on: May 05, 2013, 01:09:32 am »
Is it also slow, when you don't move your mouse over the window? If not, what mouse are you using?

I need to move the mouse in order to move my text around the screen. But I did a simple pong program who hits the screen limits and it is smooth and I don't use Events and it is more graphics intensive than this program writing text.

8
Graphics / Re: SFML 2.0 crappy graphics on Intel GMA3150
« on: May 05, 2013, 12:38:05 am »
Ok I think the problem is related to Events Polling because if I draw simple graphics moving around the screen they move smooth.

9
Graphics / Re: SFML 2.0 crappy graphics on Intel GMA3150
« on: May 03, 2013, 06:39:32 pm »
It works slightly better but still slow, here is the code, I added the color transparent to hide the text when I release the mouse button:

#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <Thor/Animation.hpp>
#include <Thor/Particles.hpp>
#include <iostream>

int main()
{
    bool moveText = false;

    // Create the main window
    sf::RenderWindow Ventana(sf::VideoMode(800, 600), "Prueba Juego con SFML");

    // Create a graphical string to display
    sf::Font font;
    if(!font.loadFromFile("gkfont.ttf")) return EXIT_FAILURE;
    sf::Text mText("Hello!! :D", font, 50);

    sf::Music miMusica;
    if (!miMusica.openFromFile("musica.ogg")) return EXIT_FAILURE;

    Ventana.setFramerateLimit(60);
    mText.setColor(sf::Color::Transparent);

    // Start the game loop
    while (Ventana.isOpen()){
        // Process events
        sf::Event Event;
        while (Ventana.pollEvent(Event)){
            // Close window : exit
            if (Event.type == sf::Event::Closed) Ventana.close();
            else if(Event.type == sf::Event::KeyPressed && moveText){
                if(Event.key.code == sf::Keyboard::A) mText.setCharacterSize(mText.getCharacterSize()-2);
                if(Event.key.code == sf::Keyboard::S) mText.setCharacterSize(mText.getCharacterSize()+2);

            }
            else if(Event.type == sf::Event::KeyPressed){
                if(Event.key.code == sf::Keyboard::P) miMusica.pause();
                if(Event.key.code == sf::Keyboard::O) miMusica.play();
            }
            else if(Event.type == sf::Event::MouseButtonReleased) mText.setColor(sf::Color::Transparent);
        }

        if(sf::Mouse::isButtonPressed(sf::Mouse::Left)){
                mText.setColor(sf::Color::White);
            mText.setPosition(static_cast<sf::Vector2f>(sf::Mouse::getPosition(Ventana)));
        }

        // Update the window
        Ventana.clear(sf::Color::Black);
        Ventana.draw(mText);
        Ventana.display();
    }
}

10
Graphics / Re: SFML 2.0 crappy graphics on Intel GMA3150
« on: May 03, 2013, 05:54:00 pm »
Nice! Thank you! The flashing screen has disappeared and the text is being rendered correctly I can read it now :D
But still it is very slow, the movement is not smooth at all! I am not an expert on graphics but how can't a simple text move along a screen but if I run Warcraft 3 on OpenGL mode runs smooth (on low graphics)

11
Graphics / SFML 2.0 crappy graphics on Intel GMA3150
« on: May 03, 2013, 03:19:04 am »
Hello! I have recently started using SFML 2.0 with Thor 2.0. I made an example program to learn how the library works and I have correctly running it on my Ubuntu x64 PC in Eclipse:

#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <Thor/Animation.hpp>
#include <Thor/Particles.hpp>
#include <iostream>

int main()
{
        bool moveText = false;

        // Create the main window
        sf::RenderWindow Ventana(sf::VideoMode(800, 600), "Prueba Juego con SFML");

        // Create a graphical string to display
        sf::Font font;
        if(!font.loadFromFile("gkfont.ttf")) return EXIT_FAILURE;
        sf::Text mText("Hello!! :D", font, 50);

        sf::Music miMusica;
    if (!miMusica.openFromFile("musica.ogg")) return EXIT_FAILURE;

    Ventana.setFramerateLimit(60);
    Ventana.clear(sf::Color::Black);

        // Start the game loop
        while (Ventana.isOpen()){
                // Process events
                sf::Event Event;
                while (Ventana.pollEvent(Event)){
                        // Close window : exit
                        if (Event.type == sf::Event::Closed) Ventana.close();
                        if (Event.type == sf::Event::MouseButtonPressed){
                                mText.setPosition(Event.mouseButton.x, Event.mouseButton.y);
                                Ventana.draw(mText);
                                moveText = true;
                        }
                        if(Event.type == sf::Event::MouseMoved && moveText == true){
                                Ventana.clear(sf::Color::Black);
                                mText.setPosition(Event.mouseMove.x, Event.mouseMove.y);
                                Ventana.draw(mText);
                        }
                        if(Event.type == sf::Event::MouseButtonReleased){
                                Ventana.clear(sf::Color::Black);
                                moveText = false;
                        }
                        if(Event.type == sf::Event::KeyPressed && moveText){
                                if(Event.key.code == sf::Keyboard::A) mText.setCharacterSize(mText.getCharacterSize()-2);
                                if(Event.key.code == sf::Keyboard::S) mText.setCharacterSize(mText.getCharacterSize()+2);
                                Ventana.clear(sf::Color::Black);
                                Ventana.draw(mText);
                        }
                        if(Event.type == sf::Event::KeyPressed){
                                if(Event.key.code == sf::Keyboard::P) miMusica.pause();
                                if(Event.key.code == sf::Keyboard::O) miMusica.play();
                        }
                }
                // Update the window
                Ventana.display();
        }

        return EXIT_SUCCESS;
}

The program simply shows a text where the mouse pointer is, you can change its size pressing keys A and S and play music pressing O and P, everything ok.
The problem is when I try to run it on my netbook with Windows XP x86, Intel GMA3150, 1Gb RAM and Intel Athom even this very simple program is very slow and choppy:
  • I can see the window refreshing (the window flashs white)
  • Text movement is slow and not smooth as in my other PC
  • Even if I don't show any text screen flash unless I delete Ventana.display() from the loop

The graphics card have OpenGL v1.4 I think it should be ok to display a simple text. I already updated the drivers to the latest version. Hope you can help me :)

12
SFML projects / Re: Thor 2.0
« on: May 01, 2013, 11:34:26 pm »
In general, you should use the release libraries. If you build Thor with CMake, set CMAKE_BUILD_TYPE to "Release". To link Thor, choose the library without -d prefix; in your linker settings, you can just specify "thor".

On Linux, the debug libraries are only needed if you need debugging symbols (i.e. you want to debug the library).

Nice, thank you for the info ! I have seen also that debug libraries have much more file size than release libraries (sorry my bad english)
Thank you very much for your help!

13
SFML projects / Re: Thor 2.0
« on: May 01, 2013, 05:31:33 pm »
Try sudo ldconfig to update the linker paths. Is there a reason why you link to the release version of SFML, but the debug version of Thor?

You are amazing Nexus :D It worked perfectly! Seems that something messed up!
Actually, I don't know what is the difference between Release and Debug libraries, I have always used libraries simply putting #include in my program is the first time I have to use a library and don't know why and haven't found nothing about it  :-\

14
SFML projects / Re: Thor 2.0
« on: May 01, 2013, 03:56:31 pm »
So is the libthor-d.so in the SFML directory? ???
Otherwise you'll also have to add /Thor/lib to the linking command.

Yes, the library is in SFML-2.0/lib as you can see here:

ls '/home/andres/Dropbox/Development/SFML-2.0/lib'
libsfml-audio.so         libsfml-network.so      libsfml-window.so
libsfml-audio.so.2       libsfml-network.so.2    libsfml-window.so.2
libsfml-audio.so.2.0     libsfml-network.so.2.0  libsfml-window.so.2.0
libsfml-graphics.so      libsfml-system.so          libthor-d.so
libsfml-graphics.so.2    libsfml-system.so.2
libsfml-graphics.so.2.0  libsfml-system.so.2.0

In my Thor folder I have no lib folder, the library was compiled directly in SFML lib folder.

/usr/local/lib is not set by default for the LD_PATH_LIBRARY, so you'll have to set LD_PATH_LIBRARY with /usr/local/lib manually first for the linker to search in that directory.
I have added it because SFML also have libraries in /usr/local/lib:

cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf
include /usr/local/lib

Is very strange. To build Thor I have used this inside Thor directory:

cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX='/home/andres/Dropbox/Development/SFML-2.0' -D SFML_INCLUDE_DIR=/home/andres/Dropbox/Development/SFML-2.0/include -D SFML_ROOT=/home/andres/Dropbox/Development/SFML-2.0 -D THOR_BUILD_DOC=TRUE -D THOR_BUILD_EXAMPLES=TRUE -D THOR_SHARED_LIBS=TRUE .
make
sudo make install

I have it running OK on my Windows XP machine with Eclipse too.
Here you can see an image of how are my linker settings configured: https://www.dropbox.com/s/p0lp1jt2c2iqcq3/Eclipse.png

15
SFML projects / Re: Thor 2.0
« on: May 01, 2013, 06:05:00 am »
Hello! I am new at SFML 2.0 and I wanted to try Thor, I have successfully compiled SFML and Thor (with C++11 flag) and have it working on Eclipse CDT. The problem is when I try to run my program using Thor I get this:

/home/andres/Dropbox/workspace/PruebaSFML/Debug/PruebaSFML: error while loading shared libraries: libthor-d.so: cannot open shared object file: No such file or directory

I have /SFML-2.0/lib added to my linker and the library libthor-d.so exists and also I have copied it to /usr/local/lib but still the same error. I am on Ubuntu 12.04 x64. What I am missing?

PD: I have it running ok on Windows XP x86

Pages: [1]
anything