Sign in to follow this  
wicked357

DirectX in a console

Recommended Posts

I have been curious about creating DirectX in a console program using int main instead of int WINAPI WinMain, from my understandings you cannot do this, but I have noticed you choose your renderer device in Irrlicht Engine and it is all created in a int main function and very clean. Anyone have any ideas or examples of how this works I am more curious from a learning point of view, any suggestions/pointers are much appreciated. Thank you.

Share this post


Link to post
Share on other sites
If you include windows.h and link to the appropriate libraries (probably kernal32.lib, user32.lib, etc.), you can certainly create a window with CreateWindow(...).


Share this post


Link to post
Share on other sites
[quote name='Tispe' timestamp='1298392838' post='4777567']
you won't get any messages from windows with winproc then I guess
[/quote]
Is that true though? If you use main() rather than WinMain(), make the appropriate changes to your project to facilitate that, use GetModuleHandle() to get the application instance handle, and then do everything else as you would normally, would that not work? (I don't know, as I've never tried it myself - I'm just curious.)

Share this post


Link to post
Share on other sites
[quote name='Tispe' timestamp='1298392838' post='4777567']
you won't get any messages from windows with winproc then I guess
[/quote]
That's not true at all. It works fine as described.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this