Skip to main content
gamedev.net
🔒 Locked

newbee problem

Started by edwinnie 4 replies 200+ views
Original Post
edwinnie
edwinnie
i am trying to set a macro to enable a resolution change using a virtual key code. the code below is of directx6, but y do i have this error called "undeclared identifier: VK_1"? and how do should i declare it, considering its a virtual key code? if (KEY_DOWN(VK_1)) { if (DirectDrawCreate(NULL,&lpdd,NULL)!=DD_OK) return(0); // set cooperation level to windowed mode normal if ((lpdd->SetCooperativeLevel(main_window_handle, DDSCL_ALLOWMODEX | DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT))!=DD_OK) return(0); if ((lpdd->SetDisplayMode(800,600,32))!=DD_OK) return(0); }
edwinnie
edwinnie
i do have this line in my code>

#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)

is there anything else i have missed out?
remi
remi
yah edwinnie,
i had the same problem while using the virtual keys like VK_A,VK_B,...VK_Z,VK_0,..VK_1. But i solved it using their hexadecimal values instead of them and it worked. Look at it in msdn.
Hope it works!

[edited by - remi on April 9, 2002 6:25:21 AM]
"...and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces."----------Scott Meyers, "Effective C++"
edwinnie
edwinnie
ok i read the msdn

well...it seems that VK_1...blah blah and some are not supported any more i guess?

now that problem is out, heres another i thought of>

i managed to use GDI to setup a menu for switching resolutions.
but if i dun wan to use a menu, how do i do it in terms of directx6?

Topic Locked

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

Sign in to reply to this topic.