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.


Topics - virus7

Pages: [1]
1
Graphics / A weird message when loading a file to Texture !
« on: June 16, 2013, 03:16:06 pm »
Here's my code :

#include <SFML/Graphics.hpp>
#include <string>
#include <iostream>

int main(void) {
        sf::RenderWindow Window;
        Window.create(sf::VideoMode(640, 480), "First app", sf::Style::Titlebar | sf::Style::Close);

        sf::Texture pTexture;
        sf::Sprite playerImage;

        pTexture.loadFromFile("player.png");
        playerImage.setTexture(pTexture);

        while(Window.isOpen()) {
                sf::Event Event;
                while(Window.pollEvent(Event)) {
                        switch(Event.type) {
                                case sf::Event::Closed :
                                        Window.close();
                                        break;                 
                        }
                }

                Window.draw(playerImage);
                Window.display();
        }
}

And here's the message that come on the console window :

An internal OpenGL call failed in Texture.cpp <146> : GL_INVALID_ENUM, an unacceptable
value has been specified for an enumerated argument
An internal OpenGL call failed in Texture.cpp <147> : GL_INVALID_ENUM, an
unacceptable value has been specified for an enumerated argument

2
Graphics / My game run really slow when using sf::Text ? : (
« on: August 02, 2012, 01:35:08 pm »
Hello,

I'm using SFML 2.0.

I only have three instances of the Text class :


sf::Text heroText("Get of my face ... ");
sf::Text instText("Press 'Space' to speak with people, 'Z' or 'X' to rotate \n and arrows to move");
sf::Text anonyText("?");
 

However, when I draw those instances like this :


window.draw(heroText);
window.draw(instText);
window.draw(anonyText);
 

the program at first run slow, but then after like 15 seconds it return to it's normal speed.
So why when I remove the window.draw functions it run at normal speed , but when I use them it run slow at first ?

Pages: [1]
anything