KeyPressed with DJGPP? keys.h?
After I started to program using DirectDraw and locking surfaces to create own effects & funktions I made a raycaster. I noticed that it was very slow. So I decided to make it in DOS(32bit)
I downloaded DJGPP. And I can now switch to screen 13 and load a bitmap and show it. But the big problem is: how do I get what key is pressed?
I looked in a file named: keys.h
There was a huge list of defines of every key:
ie. #define K_Right 0x035 something like that
and it sais that those values would be returned by getkey()
so I tried to make my main look like this:
while(getkey() != K_Escape) it compiled alright, but didn''t work.
WHY? How should I do it?
Please help
"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."
"To some its a six-pack, to me it's a support group."
you have to set an interrupt handler
in order to get more than one key up to around four keys at a time(one game loop)
hmm i wrote a tutorial for that...but i didn''t write the djgpp source code ver altough ofcourse i have it for my own
anyways here is a link to a good site with tutorials for djgpp
Inverse Reality
and don''t use libs, that''s why yer in DOS now!!
Arkon
[QSoft Systems]
in order to get more than one key up to around four keys at a time(one game loop)
hmm i wrote a tutorial for that...but i didn''t write the djgpp source code ver altough ofcourse i have it for my own
anyways here is a link to a good site with tutorials for djgpp
Inverse Reality
and don''t use libs, that''s why yer in DOS now!!
![](smile.gif)
Arkon
[QSoft Systems]
Arkon> Thanks
And as Arkon said. I''m using DOS to get aways from all libraries. So no Allegro or other game libraries, thanks.
BTW. Allegro won''t work on Win2k
And as Arkon said. I''m using DOS to get aways from all libraries. So no Allegro or other game libraries, thanks.
BTW. Allegro won''t work on Win2k
"To some its a six-pack, to me it's a support group."
Hello.
This isn''t what you want to hear but here it is:
Download and use Allegro.
I''m not ignoring what you said before but here''s my reasoning:
1. You are in search of speed.
2. You''ve already switched from DirectDraw to DJGPP. Allegro is made *using* DJGPP.
3. Allegro is the best game library I know of. It was developed over the course of years merely to be the fastest and most compatible. There is also a Windows version. Not only that, the library is open source so if you are still unhappy with the speed you can play with the code yourself.
4. You can set the screen resolution in 1 line. Keyboard input is just as easy. There are clear examples so you don''t need to ask about it here unless you''re really doing something complex.
5. It''s a game library. It is complete. It supports sound, MIDI music, video. Everything you need if you want to continue on to make games (though you didn''t say you wanted to).
You really can''t go wrong. That is just my opinion though.
(Did I accidentally give the impression that I like Allegro.
)
Good luck with whatever developing system you end up on.
Here''s the Allegro homepage if you''re curious.
http://www.talula.demon.co.uk/allegro/
This isn''t what you want to hear but here it is:
Download and use Allegro.
I''m not ignoring what you said before but here''s my reasoning:
1. You are in search of speed.
2. You''ve already switched from DirectDraw to DJGPP. Allegro is made *using* DJGPP.
3. Allegro is the best game library I know of. It was developed over the course of years merely to be the fastest and most compatible. There is also a Windows version. Not only that, the library is open source so if you are still unhappy with the speed you can play with the code yourself.
4. You can set the screen resolution in 1 line. Keyboard input is just as easy. There are clear examples so you don''t need to ask about it here unless you''re really doing something complex.
5. It''s a game library. It is complete. It supports sound, MIDI music, video. Everything you need if you want to continue on to make games (though you didn''t say you wanted to).
You really can''t go wrong. That is just my opinion though.
(Did I accidentally give the impression that I like Allegro.
![](smile.gif)
Good luck with whatever developing system you end up on.
Here''s the Allegro homepage if you''re curious.
http://www.talula.demon.co.uk/allegro/
GameCreator->
you are talking bullshit
"you are in search of speed"
why can''t i or anyone else write the CODE WITH OPTIMIZATIONS IN ASSEMBLER
huh
damn it!!!!!!!!!
and i can do a game in one line
void main() { callgamestart(); } // voila
you are talking bullshit man
he wants to learn he doesn''t want to use stuff like you do
and i bet i know better than you if this is yer attitude!!
Arkon
[QSoft Systems]
you are talking bullshit
"you are in search of speed"
why can''t i or anyone else write the CODE WITH OPTIMIZATIONS IN ASSEMBLER
huh
damn it!!!!!!!!!
and i can do a game in one line
void main() { callgamestart(); } // voila
you are talking bullshit man
he wants to learn he doesn''t want to use stuff like you do
and i bet i know better than you if this is yer attitude!!
Arkon
[QSoft Systems]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement