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

Pages: [1]
1
Graphics / OpenGL performance issue
« on: July 28, 2008, 10:35:31 pm »
Hi again,

i have minimized the 2 testprograms.

They were both tested under VS 2008 WinXp and working, dll, lib files are included in the projects so it should work without any changes, just compile debug / release mode and run. At least i hope so :)

I think the two programs are only working under Windows correct, is this a problem for you Laurent?

Short Keyboard notice:

F1 - Draw de-/activate
F2 - Enable/Disable DisplayLists
F3 - Enable/Disable CullFace
Esc - End program

Both programs start in FullScreen.

For further help see readme.txt File in the zip File.

http://rapidshare.de/files/40105123/SFML_SDL_OpenGLTest.zip.html :D

2
Graphics / OpenGL performance issue
« on: July 27, 2008, 11:16:27 pm »
I hope I understand you right, here is the reduced code:

initial part:
Code: [Select]
sf::Window App(sf::VideoMode(800, 600, 32), "SFML OpenGL", sf::Style::Fullscreen);


while loop:

I asume, the event part is almost the same but i will leave it here..
Code: [Select]

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


         if ((Event.Type == sf::Event::KeyPressed) ) {

            switch(Event.Key.Code){
               case sf::Key::F2:
                  displayListActive = !displayListActive;
                  if(displayListActive)
                     printf("DRAW with DisplayList: TRUE \n");
                  else
                     printf("DRAW with DisplayList: FALSE \n");
                  break;
               case sf::Key::Escape:
                  App.Close();
                  break;
               default:
                  break;
            }
         }
        }

      //DRAW SPHERES...

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

    }


3
Graphics / OpenGL performance issue
« on: July 27, 2008, 05:06:43 pm »
Hi,

so we changed it from RenderWindow to Window, but unfortunately without any improvment.

Maybe someone can name us here a good profiler, because we tried gDebugger but couldn't get really along with it.

We are both using XP because we knew there would be trouble with vista and OpenGL drivers, etc...

here is the init part:
Code: [Select]


sf::Window App(sf::VideoMode(800, 600, 32), "SFML OpenGL", sf::Style::Fullscreen);

 // Enable Z-buffer read and write
    glEnable(GL_DEPTH_TEST);
    glDepthMask(GL_TRUE);
    glClearDepth(1.f);
glClearColor(0.f, 0.f, 0.f, 0.f);

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

    glColor4f(1.f, 1.f, 1.f, 1.f);


and the while loop:
Code: [Select]

    while (App.IsOpened())
    {

if(cullFaceActive)
glEnable(GL_CULL_FACE);
else
glDisable(GL_CULL_FACE);

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


if ((Event.Type == sf::Event::KeyPressed) ) {

switch(Event.Key.Code){
case sf::Key::F2:
displayListActive = !displayListActive;
if(displayListActive)
printf("DRAW with DisplayList: TRUE \n");
else
printf("DRAW with DisplayList: FALSE \n");
break;
case sf::Key::Escape:
App.Close();
break;
default:
break;
}
}
        }



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

        // Apply some transformations
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();

        if (drawActive) {
actualGameTime = (float)timeClass->getElapsedGameTime();
glTranslatef(0.f, 0.f, -200.f);

glRotatef(actualGameTime * 50, 1.f, 0.f, 0.f);
glRotatef(actualGameTime * 30, 0.f, 1.f, 0.f);
glRotatef(actualGameTime * 90, 0.f, 0.f, 1.f);

draw();
}


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

fps = (float)timeClass->getFPS(&avgFPS, &avgCounter);
    }



-tno

4
Graphics / GL_INVALID_ENUM in renderwindow.cpp
« on: April 27, 2008, 02:50:43 pm »
@MrDoomMaster:

didn't mean to spam u and why are 2 PM msgs classified as SPAM?? (Did i send it to 100 people? No, only to you because I saw you had the same problem --> http://www.sfml-dev.org/forum/viewtopic.php?t=195 )

My only intent was that you probably can share with us what you have figured out because you had the same problem (see other thread).
Maybe you can share it now with us? I think we would all appreciate it.

Isn't that the meaning of a forum?

@Redien: thx a lot! I don't know why we set there this glEnable.....
The error is gone, also when i am using RenderWindow. :)

greetz
-tno

5
Graphics / GL_INVALID_ENUM in renderwindow.cpp
« on: April 26, 2008, 07:47:08 pm »
hmmm ....thats right, but we are using only openGL stuff to draw so therefor it is clear that this wouldn't work fine with the graphics package... or, do i missunderstand sth here?

6
Graphics / GL_INVALID_ENUM in renderwindow.cpp
« on: April 26, 2008, 07:07:52 pm »
Shoot!!!

I think i have figured out what caused the error by myself and thankfully to the tutorial at SFML Website, which i haven't read until now.

http://www.sfml-dev.org/tutorials/window-opengl.php

Instead of using a
Code: [Select]
RenderWindow i am now using a
Code: [Select]
Window in the Code.

The following include :
Code: [Select]
#include <SFML/Graphics.hpp>
is replaced by those includes:
Code: [Select]
#include <SFML/Window.hpp>
#include <GL/gl.h>
#include <GL/glu.h>


I didn't see it all this time!!


Hope this here helps anyone else who CAN'T READ the tutorials right!! :(

7
Graphics / GL_INVALID_ENUM in renderwindow.cpp
« on: April 26, 2008, 06:25:51 pm »
damn.

But i was searching a lil bit in the forum and found the same problem in another thread but the solution isn't described ... :(

I will write him a PM to post his solution.

Hope he sees that.

http://www.sfml-dev.org/forum/viewtopic.php?t=195

So long, tno

8
Graphics / GL_INVALID_ENUM in renderwindow.cpp
« on: April 26, 2008, 05:30:53 pm »
again here some news:

We have a main class, a render class and a AppWindow class (this class we did make on purpose because we need access from some other classes too).

In the main class we call "AppWindow Init" which executes this code:
Code: [Select]
App.Create(sf::VideoMode(width, height), "Title"/*, sf::Style::Fullscreen*/);
App.SetCursorPosition(getWidth()/2, getHeight()/2);

and next in the main class again the Render.initGL function is called which executes some GL Stuff like Depth_Test, Lighting and Texture enable, Smooth Shading, etc... and also this 2 lines:
Code: [Select]
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glEnable(GL_PERSPECTIVE_CORRECTION_HINT);


If we now disable the 2 lines with comments then the INVALID Error disappears, we dont know why but maybe this gives you an idea, Laurent?

A Screenshot of the Error:



-tno

9
Graphics / GL_INVALID_ENUM in renderwindow.cpp
« on: April 25, 2008, 12:07:32 am »
Hi there,

we are two guys working for the first time with SFML.

After we have implemented some stuff to our upcoming game (in OpenGL), we've got an mysterious error that we can't narrow down.
Quote

An internal OpenGL call failed in renderwindow.cpp (234) : GL_INVALID_ENUM, an unacceptable value has been specified for an enumerated argument.


U can see where it appears. We checked the line at the SRC of SFML and dont unterstand why we get it there. The only thing we know now is that the light class, which we have implemented, might cause the error.

Someone else maybe has got this error and can help us?

We would appreciate any help, thx!

-tno

Pages: [1]
anything