hello guys...this is my first post here on forums
im workin on game project, n im tryin to make window with "Hello Word", but i get error
An internal OpenGL call failed in Texture.cpp (327) : GL_INVALID_VALUE , a numeric argument
is out of range
here is the code, it doesn't show any compiler errors.
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include <iostream>
#include <stdio.h>
int main() {
sf::RenderWindow window(sf::VideoMode(800, 600), "Test Window", sf::Style::Titlebar, sf::ContextSettings(32));
window.setFramerateLimit(60);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.f, 1.f, 1.f, 500.f);
sf::Event event;
while (window.isOpen()) {
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed)
window.close();
if ((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape))
window.close();
if (event.type == sf::Event::Resized)
glViewport(0, 0, event.size.width, event.size.height);
}
window.setActive();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
float x = sf::Mouse::getPosition(window).x * 200.f / window.getSize().x - 100.f;
float y = -sf::Mouse::getPosition(window).y * 200.f / window.getSize().y + 100.f;
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
window.pushGLStates();
sf::Text text(L"Hello World!");
text.setPosition(250.f, 450.f);
text.setColor(sf::Color(255, 255, 255, 128));
window.draw(text);
window.popGLStates();
window.display();
}
return EXIT_SUCCESS;
}
hope someone can help me .... thanks in advance