Skip to main content
gamedev.net
🔒 Locked

auxKeyFunc Problem

Started by Ivanch0 Dec 27, 2004 at 9:19 AM 2 replies 2.5k views
Original Post
Ivanch0
Ivanch0
Hi again, my problem its that i want move my camera with auxKeyFunc (without GLUT library)Ihave this code: void CALLBACK KeyFunc(void) { Cam->PosX=Cam->PosX; Cam->PosY=Cam->PosY+10; Cam->PosZ=Cam->PosZ; } int main(int argc, char* argv[]) { auxKeyFunc(AUX_SPACE,KeyFunc); glShadeModel (GL_SMOOTH); auxIdleFunc(Repintar); auxReshapeFunc(Escalado); auxMainLoop(Repintar); return 0; } and my program never execute KeyFunc function...And i press space bar... Any idea? Thanks for all and happy new year.
harry_x
harry_x
AFAIK you have to initialize aux window first.
try adding this to beginning of main():
auxInitDisplayMode(AUX_SINGLE | AUX_RGBA);
auxInitPosition(0,0,640, 480);
auxInitWindow(argv[0]);
Ivanch0
Ivanch0
The same result the program not enter never in KeyFunc :(
harry_x
harry_x
I can't see why it isn't working for you. This small program works fine on my system (linux with libaux from SGI). Maybe you should try compiling to see if it run. If not, what libaux are you using?
#include <GL/gl.h>#include <stdio.h>#include "aux.h"void display() {}void h_space() {	printf("h_space()\n");}int main(int argc,char *argv[]) {	auxInitDisplayMode(AUX_SINGLE | AUX_RGBA);	auxInitPosition(0,0,640,480);	auxInitWindow(argv[0]);      	auxKeyFunc(AUX_SPACE, h_space);	auxMainLoop(display);        return 0;}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.