Hey there, was wondering if anyone else has this issue.
I've checked to see if it was my drivers, but no.
the GL window wont move, it won't accept any inputs at all.
but it shows everything else.
I've tried everything in my memory bank.. and still nothing.
this is including rewriting the program, and implementing SDL as an input handler.
this is my cleaned out code (still wont accept anything) but still runs.
HALP!
#include <GL/glew.h>
#include <GL/glut.h>
#include <iostream>
using namespace std;
bool* keyStates = new bool[256];
GLuint LoadTexture(char *TexName);
void keyOperations (void) {
if (keyStates['w']) {
cout << "RAWR W WAS PRESSED" << endl;
}
if (keyStates['s']) {
cout << "RAWR S WAS PRESSED" << endl;
}
}
void display (void) {
keyOperations();
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -5.0f);
glFlush();
}
void reshape (int width, int height) {
glViewport(0, 0, (GLsizei)width, (GLsizei)height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60, (GLfloat)width / (GLfloat)height, 1.0, 100.0);
glMatrixMode(GL_MODELVIEW);
}
void keyPressed (unsigned char key, int x, int y) {
keyStates[key] = true;
cout << key;
}
void keyUp (unsigned char key, int x, int y) {
keyStates[key] = false;
}
int main (int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE);
glutInitWindowSize (500, 500);
glutInitWindowPosition (100, 100);
glutCreateWindow ("OGL");
glutDisplayFunc(display);
glutIdleFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyPressed);
glutKeyboardUpFunc(keyUp);
glEnable (GL_DEPTH_TEST);
for (int i = 0; i < 256; i++)
keyStates[i] = false;
glutMainLoop();
}