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

Pages: [1] 2 3
1
General discussions / The new graphics API in SFML 2
« on: September 19, 2011, 09:51:02 pm »
Quote
maybe sf::Transformable?

or sf::Spatial ?

2
General / SFML/Box2D Help
« on: July 30, 2011, 07:38:28 am »
You can check this blog : http://box2dsfmlfun.blogspot.com/

OR just use the Search feature of this forum...

3
General / hey guys, i got a problem..
« on: June 17, 2011, 12:41:48 pm »
Sounds good, but you have to LINK the libraries too.
With Visual Studio, use this in your code :
Code: [Select]
#pragma comment(lib, "sfml-system.lib")
...

4
SFML projects / [RELEASED] SFMLUploads.Org
« on: June 14, 2011, 11:14:59 pm »
Really good initiative and nice work !  8)

I started playing with the website, but I noticed a display error when the logout link is hovered (Chrome 12).

When you move your mouse over, the link goes bold and moves to the line below, which makes the click impossible.

5
SFML projects / [sf3d] a project for 3D rendering
« on: June 14, 2011, 09:00:25 pm »
@Tank : sf3d is supposed to be as generic as possible. A converter tool ? Yes, why not using sf3d library ?
I can ensure that 3D integration is done as easily as possible within an SFML project. But, it's up to you to decide if you need a custom file format (for optimization reasons) for your project, and where appropriate, it will make sense to develop it, yes !

@Alejandro :
I know that some 2D engines uses 3D baked characters and split them to multiple tiles. (Holyspirit ?) It adds a lot of quality and realism to your scene.
To answer you, I will probably add keyframe animations and skinning since Assimp handle both of them.

6
General / Upgrading to SFML 2.0
« on: June 12, 2011, 07:23:54 pm »
SFML 2.0 is not released yet, but Laurent often communicate about major API breaks.

See here for the changes in sf::Clock :
http://www.sfml-dev.org/forum/viewtopic.php?t=4864

7
Graphics / String Class
« on: June 09, 2011, 09:01:23 am »
Read again Nexus's post ^^

8
SFML projects / [sf3d] a project for 3D rendering
« on: June 08, 2011, 08:41:59 am »
Quote
Did you consider using AssImp for loading 3d meshes?

Yes, I definitely want to use the assimp loader.
It can load interchangeable formats and other game engine mesh files.
(see here for a complete list : http://assimp.sourceforge.net/main_features_formats.html)

It's NOT intended to be a complete engine, the goal is to have simple and performant helper classes  (Matrix, renderers, importers, scene graphs, culling classes, etc...) that fit as a higher level than OpenGL (like SFML does)

9
General discussions / A new logo for SFML
« on: June 06, 2011, 07:33:58 pm »
+1 for this one

10
Graphics / qimage to sf::image conversion
« on: May 25, 2011, 11:52:48 pm »
Quote
i can read and set every pixel, but you cant read the alpha of an pixel from an qimage :O

In fact, it is possible :

Code: [Select]
QImage image;
...
QRgb pixel = image.pixel(x, y);
int alpha = qAlpha(pixel); // return your alpha component

11
Graphics / qimage to sf::image conversion
« on: May 25, 2011, 11:15:08 pm »
Yeah, it's really weird lol...

12
Graphics / qimage to sf::image conversion
« on: May 25, 2011, 10:09:49 pm »
Take a look at here :
http://doc.qt.nokia.com/latest/qglwidget.html#convertToGLFormat

So, maybe something like this...
Code: [Select]
QImage source;
...

QImage converted = QGLWidget::convertToGLFormat(source);
sf::Image final;
final.LoadFromPixels(source.width(), source.height(), reinterpret_cast<const sf::Uint8*>(converted.bits()));

13
Graphics / Sfml is 2d or 3d?
« on: May 23, 2011, 08:00:02 pm »
Sorry for the delay ;)

Yes, the project has really not evolved on the public SVN repository.
But, I still have some plans for sf3d, and maybe for the official release of SFML 2.0.

I will give you some news soon !

14
Graphics / Crazy bug using OpenGL lighting and RenderWindow
« on: May 20, 2011, 08:14:40 am »
Code: [Select]
so you should include all your opengl calls within App.SaveGLStates(); and App.RestoreGLStates();
Oh, my mistake !

You should also take a look at the OpenGL example, in  SFML sources.

15
Graphics / Crazy bug using OpenGL lighting and RenderWindow
« on: May 18, 2011, 08:48:31 pm »
SFML uses its own OpenGL statements, so you should include all your opengl calls within App.SaveGLStates(); and App.RestoreGLStates();

And, there is an error on your gluPerspective ratio, App.GetWidth() and App.GetHeight() need to be casted to float numbers like this :
Code: [Select]
gluPerspective(70.f, static_cast<float>(App.GetWidth()) / static_cast<float>(App.GetHeight()), 1.f, 600.f);

So here is a code which works for me :
Code: [Select]

#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>

int main()
{
    sf::Clock clock;
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML + OpenGL", sf::Style::Default, sf::ContextSettings(32));


    float red[] = {102.f/255.f, 51.f/255.f, 51.f/255.f};
    float blue[] = {51.f/255.f, 51.f/255.f, 102.f/255.f};
    float green[] = {51.f/255.f, 102.f/255.f, 51.f/255.f};

GLfloat light_ambient[] = {0.0, 0.0, 0.0, 1.0};
GLfloat light_diffuse[] = {1.0, 1.0, 1.0, 1.0};
GLfloat light_specular[] = {1.0, 1.0, 1.0, 1.0};
GLfloat light_position[] = {0.0, 0.0, 1.0, 0.0};

    while (App.IsOpened())
    {
        sf::Event Event;
        while (App.PollEvent(Event))
        {
            if (Event.Type == sf::Event::Closed)
                App.Close();

            if (Event.Type == sf::Event::Resized)
                glViewport(0, 0, Event.Size.Width, Event.Size.Height);
        }

App.Clear(sf::Color(0, 0, 0, 1));

        App.SaveGLStates();

glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glClearDepth(1.f);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(70.f, static_cast<float>(App.GetWidth()) / static_cast<float>(App.GetHeight()), 1.f, 600.f);

glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);

glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);

        //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        glClear(GL_DEPTH_BUFFER_BIT);

        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);

            glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
            glColor3f(1.f, 0.f, 0.f);
            glNormal3f(0.f, 0.f, -1.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);

            glColor3f(1.f, 0.f, 0.f);
            glNormal3f(0.f, 0.f, 1.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);

            glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
            glColor3f(0.f, 1.f, 0.f);
            glNormal3f(-1.f, 0.f, 0.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);

            glColor3f(0.f, 1.f, 0.f);
            glNormal3f(1.f, 0.f, 0.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);

            glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
            glColor3f(0.f, 0.f, 1.f);
            glNormal3f(0.f, -1.f, 0.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);

            glColor3f(0.f, 1.f, 0.f);
            glNormal3f(0.f, 1.f, 0.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();


        App.RestoreGLStates();
       
        App.Display();
    }
    return EXIT_SUCCESS;
}

Pages: [1] 2 3
anything