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 - armaskywalker

Pages: [1]
1
Window / SFML OpenGL lib glut.h problem
« on: February 15, 2012, 01:03:26 pm »
Quote from: "tobybear"
It seems you aren't linking to "glut32.lib" ?

solved ;)
i have forgot to link at linker setting:
Code: [Select]

-lopengl32
-lglu32
-lglut32

And copy dll on project Debug folder :D

excuse me but the documentation is all in English and Italian do not find anything, sometimes I get lost :D
Thanks again

2
Window / SFML OpenGL lib glut.h problem
« on: February 15, 2012, 12:44:41 pm »
Hi again :D
I try to run OpenGL test from the tutorial:
Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>
#include <GL/glut.h>

////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML OpenGL");

    // Create a clock for measuring time elapsed
    sf::Clock Clock;

    // Set color and depth clear value
    glClearDepth(1.f);
    glClearColor(0.f, 0.f, 0.f, 0.f);

    // Enable Z-buffer read and write
    glEnable(GL_DEPTH_TEST);
    glDepthMask(GL_TRUE);

    // Setup a perspective projection
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(90.f, 1.f, 1.f, 500.f);

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();

            // Escape key : exit
            if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
                App.Close();

            // Resize event : adjust viewport
            if (Event.Type == sf::Event::Resized)
                glViewport(0, 0, Event.Size.Width, Event.Size.Height);
        }

        // Set the active window before using OpenGL commands
        // It's useless here because active window is always the same,
        // but don't forget it if you use multiple windows or controls
        App.SetActive();

        // Clear color and depth buffer
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        // Apply some transformations
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
        glTranslatef(0.f, 0.f, -200.f);
        glRotatef(Clock.GetElapsedTime() * 50, 1.f, 0.f, 0.f);
        glRotatef(Clock.GetElapsedTime() * 30, 0.f, 1.f, 0.f);
        glRotatef(Clock.GetElapsedTime() * 90, 0.f, 0.f, 1.f);

        // Draw a cube
        glBegin(GL_QUADS);

            glVertex3f(-50.f, -50.f, -50.f);
            glVertex3f(-50.f,  50.f, -50.f);
            glVertex3f( 50.f,  50.f, -50.f);
            glVertex3f( 50.f, -50.f, -50.f);

            glVertex3f(-50.f, -50.f, 50.f);
            glVertex3f(-50.f,  50.f, 50.f);
            glVertex3f( 50.f,  50.f, 50.f);
            glVertex3f( 50.f, -50.f, 50.f);

            glVertex3f(-50.f, -50.f, -50.f);
            glVertex3f(-50.f,  50.f, -50.f);
            glVertex3f(-50.f,  50.f,  50.f);
            glVertex3f(-50.f, -50.f,  50.f);

            glVertex3f(50.f, -50.f, -50.f);
            glVertex3f(50.f,  50.f, -50.f);
            glVertex3f(50.f,  50.f,  50.f);
            glVertex3f(50.f, -50.f,  50.f);

            glVertex3f(-50.f, -50.f,  50.f);
            glVertex3f(-50.f, -50.f, -50.f);
            glVertex3f( 50.f, -50.f, -50.f);
            glVertex3f( 50.f, -50.f,  50.f);

            glVertex3f(-50.f, 50.f,  50.f);
            glVertex3f(-50.f, 50.f, -50.f);
            glVertex3f( 50.f, 50.f, -50.f);
            glVertex3f( 50.f, 50.f,  50.f);

        glEnd();

        // Finally, display rendered frame on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


But have this error on glut.h:
Code: [Select]
obj\Debug\main.o||In function `glutInit_ATEXIT_HACK':|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.1\..\..\..\..\include\GL\glut.h|486|undefined reference to `__glutInitWithExit@12'|
obj\Debug\main.o||In function `glutCreateWindow_ATEXIT_HACK':|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.1\..\..\..\..\include\GL\glut.h|503|undefined reference to `__glutCreateWindowWithExit@8'|
obj\Debug\main.o||In function `glutCreateMenu_ATEXIT_HACK':|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.1\..\..\..\..\include\GL\glut.h|549|undefined reference to `__glutCreateMenuWithExit@8'|
obj\Debug\main.o||In function `main':|
C:\Users\arma\Desktop\project\testopenglsfml\main.cpp|33|undefined reference to `gluPerspective@32'|
||=== Build finished: 4 errors, 0 warnings ===|


Thanks again guys :D

3
Graphics / Sprite Help
« on: February 14, 2012, 12:28:02 pm »
i have use this tutorial:
http://www.youtube.com/watch?v=sgLqziVwey4

Edit:
Maybe resolved, i have copy SFML/lib/.ddl in /bin/debug project folder
and add in linker -sfml-window,graphic ecc..

4
Graphics / more
« on: February 14, 2012, 11:52:16 am »
Now i have download MinGW-with-gcc-4.4.zip (34.9 MB) from tutorial
and put in /MinGW/Include -> /SFML/include, /MinGW/lib -> /SFML/lib
And have this errors:31
Code: [Select]
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| multiple definition of `sf::Sprite::Sprite(sf::Image const&, sf::Vector2<float> const&, sf::Vector2<float> const&, float, sf::Color const&)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000126.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::Image()'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000075.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::~Image()'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000080.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::LoadFromFile(std::string const&)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000060.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Color.o):Color.cpp|| multiple definition of `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000053.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::~Drawable()'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000162.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::SetPosition(float, float)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000141.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::SetScale(float, float)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000153.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::SetColor(sf::Color const&)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000151.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::Move(float, float)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000145.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::Rotate(float)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000150.o)|| first defined here|
obj\Debug\main.o||In function `main':|
C:\Program Files (x86)\CodeBlocks\project\SFML\test\test2\main.cpp|8|undefined reference to `__gxx_personality_sj0'|
C:\Program Files (x86)\CodeBlocks\project\SFML\test\test2\main.cpp|8|undefined reference to `_Unwind_SjLj_Register'|
C:\Program Files (x86)\CodeBlocks\project\SFML\test\test2\main.cpp|10|undefined reference to `_Unwind_SjLj_Resume'|
C:\Program Files (x86)\CodeBlocks\project\SFML\test\test2\main.cpp|50|undefined reference to `_Unwind_SjLj_Unregister'|
C:\Program Files (x86)\CodeBlocks\project\SFML\test\test2\main.cpp|50|undefined reference to `_Unwind_SjLj_Resume'|
obj\Debug\main.o||In function `~Sprite':|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\SFML\Graphics\Sprite.hpp|45|undefined reference to `__gxx_personality_sj0'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\SFML\Graphics\Sprite.hpp|45|undefined reference to `_Unwind_SjLj_Register'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\SFML\Graphics\Sprite.hpp|45|undefined reference to `_Unwind_SjLj_Resume'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\SFML\Graphics\Sprite.hpp|45|undefined reference to `_Unwind_SjLj_Unregister'|
||=== Build finished: 31 errors, 0 warnings ===|

5
Graphics / Sprite Help
« on: February 13, 2012, 09:11:27 pm »
Hello to all users, I have a compile error on codeblocks about test Graphics from SFML tutorial website.
i'm sorry for my poor english and thanks for response

Test:
Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace std;

int main()
{
   // Create the main rendering window
    sf::RenderWindow Finestra(sf::VideoMode(800, 600, 32), "SFML Graphics Test");
   //Carico l'img da file
   sf::Image Image;
   if(!Image.LoadFromFile("wall.png"))
   return EXIT_FAILURE;
   //Creo la sprite
   sf::Sprite Sprite(Image);
   //Cambio le propriet√†
   Sprite.SetColor(sf::Color(0,255,255,128));
   Sprite.SetPosition(200.f,100.f);
   Sprite.SetScale(2.f,2.f);
   //Inizio Loop Gioco
   while (Finestra.IsOpened())
   {
       //Eventi
       sf::Event Eventi;
       while (Finestra.GetEvent(Eventi))
       {
           //Chiude La finestra: exit **esci
           if(Eventi.Type ==  sf::Event::Closed)
           Finestra.Close();
       }

       //Tempo
       float ElapsedTime = Finestra.GetFrameTime();
       //Muovi lo sprite
       if(Finestra.GetInput().IsKeyDown(sf::Key::Left))  Sprite.Move(-100 * ElapsedTime,0);
       if(Finestra.GetInput().IsKeyDown(sf::Key::Right)) Sprite.Move(100 * ElapsedTime,0);
       if(Finestra.GetInput().IsKeyDown(sf::Key::Up))    Sprite.Move(0, -100 * ElapsedTime);
       if(Finestra.GetInput().IsKeyDown(sf::Key::Down))  Sprite.Move(0, 100 * ElapsedTime);
       //Ruota lo sprite
       if(Finestra.GetInput().IsKeyDown(sf::Key::Add))   Sprite.Rotate(- 100 * ElapsedTime);
       if (Finestra.GetInput().IsKeyDown(sf::Key::Subtract)) Sprite.Rotate(+ 100 * ElapsedTime);
       //Pulisci schermo
       Finestra.Clear();
       //Mostra lo sprite
       Finestra.Draw(Sprite);
       //Mostra tutto su schermo
       Finestra.Display();
   }
    return EXIT_SUCCESS;
}


Errors:42
Code: [Select]
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| multiple definition of `sf::Sprite::Sprite(sf::Image const&, sf::Vector2<float> const&, sf::Vector2<float> const&, float, sf::Color const&)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000126.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::Image()'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000075.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::~Image()'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000080.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| multiple definition of `sf::Image::LoadFromFile(std::string const&)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000060.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Color.o):Color.cpp|| multiple definition of `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000053.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::~Drawable()'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000162.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::SetPosition(float, float)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000141.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::SetScale(float, float)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000153.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::SetColor(sf::Color const&)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000151.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::Move(float, float)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000145.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp|| multiple definition of `sf::Drawable::Rotate(float)'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics.a(d000150.o)|| first defined here|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Sprite.o):Sprite.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.text$_ZN2sf6SpriteD0Ev[sf::Sprite::~Sprite()]+0x15d)||undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Sprite.o):Sprite.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp|| more undefined references to `_Unwind_Resume' follow|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Image.o):Image.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(Drawable.o):Drawable.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| undefined reference to `_Unwind_Resume'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp|| more undefined references to `_Unwind_Resume' follow|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(ImageLoader.o):ImageLoader.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
..\..\..\..\MinGW\include\SFML-1.6\lib\libsfml-graphics-s.a(GraphicsContext.o):GraphicsContext.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
||=== Build finished: 42 errors, 0 warnings ===|


Thanks :D

Pages: [1]