Sign in to follow this  

(SOLVED) [DirectX] hWnd and Direct3D problem

This topic is 3344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone! I've been at this for almost 2 days now, trying every possible way I could think of but couldn't find a way to get it to work, so I thought I'd post this before going to bed and hopefully able to finish it tomorrow.. I post this in the beginner area because I'm almost totally new to DirectX, I have a lot of experience when it comes to SDL but well, that doesn't really apply to DirectX much.. I'm trying to make a DirectX version of my game wrapper I made on OSX using SDL, but things aren't going as smooth as I hoped, actually they do but there is a small problem that's been bugging me. I love working in classes and love clean code even more, so I try to keep things in classes as much as possible.. Like the initialization of DirectX's hWnd and wc.. The moment I put those in Core.h/.cpp the graphics module using Direct3D9 refuses to work and crashes.. I can try to explain but I know i'd only make it more complicated.. So I included the full source and hope someone could perhaps take a look at it.. Here's the link; http://rapidshare.com/files/156319610/DirectInput.rar.html The main focus goes to main.cpp, globals.h/cpp and core.h/cpp I'd be very happy to hear how I could improve, do things better or how I should have done things. Looking for ways to greatly improve my way of working.. :) Thanks in advance everyone, ~Auriya (If you need more info, please do tell me and I'll reply as soon as I'm awake!)Hello everyone! I've been at this for almost 2 days now, trying every possible way I could think of but couldn't find a way to get it to work, so I thought I'd post this before going to bed and hopefully able to finish it tomorrow.. I post this in the beginner area because I'm almost totally new to DirectX, I have a lot of experience when it comes to SDL but well, that doesn't really apply to DirectX much.. I'm trying to make a DirectX version of my game wrapper I made on OSX using SDL, but things aren't going as smooth as I hoped, actually they do but there is a small problem that's been bugging me. I love working in classes and love clean code even more, so I try to keep things in classes as much as possible.. Like the initialization of DirectX's hWnd and wc.. The moment I put those in Core.h/.cpp the graphics module using Direct3D9 refuses to work and crashes.. I can try to explain but I know i'd only make it more complicated.. So I included the full source and hope someone could perhaps take a look at it.. Here's the link; http://rapidshare.com/files/156319610/DirectInput.rar.html The main focus goes to main.cpp, globals.h/cpp and core.h/cpp I'd be very happy to hear how I could improve, do things better or how I should have done things. Looking for ways to greatly improve my way of working.. :) Thanks in advance everyone, ~Auriya (If you need more info, please do tell me and I'll reply as soon as I'm awake!) EDIT: Nevermind, fixed it.. What I did wrong was to give "wc.lpszClassName" as well as "CreateWindowEx()"'s second parameter a different LPCTSTR while both had to be the exact same.. Can't believe I overlooked that.. Thanks anyway all :) [Edited by - Auriya on October 22, 2008 11:30:52 AM]

Share this post


Link to post
Share on other sites

This topic is 3344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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