Hello,
I have two questions.
First, I would like to make possible a option menu for my game to be able to chage the key the user uses to move around.
I played a litle with the switch comand, and if I put in something like
case 49: (49 is the key 1 for the ascii table)
it works, but if I declare
int test = 49;
and try:
case test:
it doesn’t work…
all the SDL_Key are number with the ascii table, and I have no idea why it didn’t work passing the variable… anyway, to get around this, will I have to make a new variable of the type SDL_Key? (or something like that, don’t know exact name right now, and can’t look it up cuz I’m on windows, and sdl is installed on linux…)
The other question is on initializing a video mode with SDL_OPENGLBLIT
instead of
SDL_OPENGL
how do I copy the opengl generated image onto the SDL_Surface?
Thanks,
Louis---------------------------------
Yahoo! Messenger - Fale com seus amigos online. Instale agora!
Hello,
I have two questions.
First, I would like to make possible a option menu for my game to be able to chage the key the user uses to move around.
I played a litle with the switch comand, and if I put in something like
case 49: (49 is the key 1 for the ascii table)
it works, but if I declare
int test = 49;
and try:
case test:
it doesn’t work…
all the SDL_Key are number with the ascii table, and I have no idea why it didn’t work passing the variable… anyway, to get around this, will I have to make a new variable of the type SDL_Key? (or something like that, don’t know exact name right now, and can’t look it up cuz I’m on windows, and sdl is installed on linux…)
The other question is on initializing a video mode with SDL_OPENGLBLIT
instead of
SDL_OPENGL
how do I copy the opengl generated image onto the SDL_Surface?
Thanks,
Louis---------------------------------
Yahoo! Messenger - Fale com seus amigos online. Instale agora!
The first question is really a general programming
question, nothing to do with SDL:
— Louis OCarroll <louis_ocarroll at yahoo.com.br>
wrote:
Hello,
I have two questions.
First, I would like to make possible a option menu
for my game to be able to chage the key the user
uses to move around.
I played a litle with the switch comand, and if I
put in something like
case 49: (49 is the key 1 for the ascii table)
In C and similar languages, you can just say ‘1’ (with
the apostrophies) and it will mean 49 to the compiler.
it works, but if I declare
int test = 49;
and try:
case test:
it doesn’t work…
Switch statements only apply to constants. Use many,
many “else if” statements. Depending on your
application design and keyboard input design, you may
want to get creative with different nested switch
statements and if statements and such. I can’t
emphasize creativity enough for this sort of thing,
it’s just a matter of thinking about it, it’s not very
complicated actually.__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/
switch comand, and if I put in something like case 49: (49 is the key 1 for
the ascii table)
it works, but if I declare
int test = 49;
and try:
case test:
it doesn’t work…
Case values must be constants, not variables.
JeffOn Tuesday 18 May 2004 08:35 pm, Louis OCarroll wrote: