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

Author Topic: I'm getting constant OpenGL error messages in SFML 2.0  (Read 2247 times)

0 Members and 1 Guest are viewing this topic.

BoomBip

  • Newbie
  • *
  • Posts: 5
    • View Profile
I'm getting constant OpenGL error messages in SFML 2.0
« on: March 07, 2012, 07:08:31 am »
I'm getting constant errors in my console box whenever I attempt to draw a sprite. For the record it looks like http://i.imgur.com/3r5ju.png The image still draws fine. The only problem is the constant stream of messages.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
I'm getting constant OpenGL error messages in SFML 2.0
« Reply #1 on: March 07, 2012, 08:02:10 am »
What graphics card do you have? Are your graphics drivers up to date?
Laurent Gomila - SFML developer

BoomBip

  • Newbie
  • *
  • Posts: 5
    • View Profile
I'm getting constant OpenGL error messages in SFML 2.0
« Reply #2 on: March 07, 2012, 10:55:46 am »
ATI Radeon HD 3200 Graphics
I'm using the latest drivers.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
I'm getting constant OpenGL error messages in SFML 2.0
« Reply #3 on: March 07, 2012, 11:15:38 am »
Do these messages really happen when you draw a sprite? They are supposed to be triggered in sf::Texture's creation function.

Can you try to call texture.SetRepeated(true) on every texture before loading/using them, and see if the message disappears?
Laurent Gomila - SFML developer

BoomBip

  • Newbie
  • *
  • Posts: 5
    • View Profile
I'm getting constant OpenGL error messages in SFML 2.0
« Reply #4 on: March 07, 2012, 06:54:26 pm »
That doesn't do anything different. Could it also happen if I assign a new texture to be applied to a sprite?

EDIT: I tried eliminating parts where textures were being reassigned and that reduced the number of errors from about 6/8 to 2. They're still happening every frame though.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
I'm getting constant OpenGL error messages in SFML 2.0
« Reply #5 on: March 07, 2012, 07:52:10 pm »
It's not clear, could you show a complete and minimal example that reproduces the problem? Just texture creation and sprite drawing, nothing from your original code please.
Laurent Gomila - SFML developer

BoomBip

  • Newbie
  • *
  • Posts: 5
    • View Profile
I'm getting constant OpenGL error messages in SFML 2.0
« Reply #6 on: March 08, 2012, 04:14:11 am »
OK. I think I figured it out. When you load a texture, you need to say: texture.SetRepeated(true) This fixes the error message (which only plays that one time). However when you load a font you can't say: font.SetRepeated(true) This creates the error. What was happening in my code was that I was loading a font every frame (inefficient, I know), thus causing the error to appear every frame.

Anyways, here's the code:
Code: [Select]

#include "SFML\Graphics.hpp"
int main()
{
//Setup
sf::RenderWindow App;
App.Create(sf::VideoMode(800, 600, 32), "OPENGL TEST");

while (App.IsOpen())
{
sf::Event Event;
while (App.PollEvent(Event))
        {
            // Close window : exit
if (Event.Type == sf::Event::Closed)
{
            App.Close();
return EXIT_SUCCESS;
}
        }

sf::Font font;
font.LoadFromFile("mizufalp.ttf");

sf::Text text;
text.SetFont(font);
text.SetString("SFML TEST");

App.Clear(sf::Color(0, 0, 0, 255));
App.Draw(text);
App.Display();
}

return EXIT_SUCCESS;
}
[/u]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
I'm getting constant OpenGL error messages in SFML 2.0
« Reply #7 on: March 08, 2012, 08:04:22 am »
Ok, it's much clearer now.

Your graphics driver doesn't support the OpenGL flag that I'm using, which was added to OpenGL 1.2. This means that your graphics card only supports OpenGL 1.1, which is strange because it doesn't seem to be that crappy. Maybe a driver bug?

Just to be sure, could you check what's returned by glGetString(GL_VERSION) (in the OpenGL example, so that you don't have to modify the project settings)?
Laurent Gomila - SFML developer

BoomBip

  • Newbie
  • *
  • Posts: 5
    • View Profile
I'm getting constant OpenGL error messages in SFML 2.0
« Reply #8 on: March 08, 2012, 06:17:06 pm »
Hmm. I may have been wrong over which driver version I had. I tried the glGetString thing and got version 1.1. Then I tried updating my graphics drivers and got version 3.xx and that also fixed the problem. However, now my original project (the one I started the issue with) triggers a Blue Screen of Death. So sorry about the mistake and I'll get back to you on the Blue Screen of Death thing.

 

anything