Archived

This topic is now archived and is closed to further replies.

Kudaba

OpenGL WinProc (in an OpenGL program though)

Recommended Posts

Well, here''s my problem, My winproc get''s the correct event message but there is either no relative information or just no information at all in the lParam and wParam. Anyone ever have this problem. I have been using the same winproc since I started windows programming (with directx) but the only time this ever happens is when I use an OpenGL program. The worst part is if I download a demo (like the first menu demo) it uses winproc, and uses it the same way, but it works in their programs, is it maybe something in the setup, or does my computer hate me? Retired Pokemon Master of Prgramming Problems I already had them all.

Share this post


Link to post
Share on other sites
Need to see code for that one. It sounds like a Glut thing though. I don't use OpenGL, but can't you use Glut or Glaux to create a window? I don't remember the details of such things.

Edited by - JonStelly on October 3, 2000 5:27:29 PM

Share this post


Link to post
Share on other sites
well, first of all, I HATE GLUT, I will not use it if you had a gun to my head.

That said, I do get the correct message. I press a key it goes into the WM_KEYDOWN, I know this because I put error messages there and log files to look at l/wParam. Heres my init of the winproc:

LRESULT CALLBACK WndProc( HWND hWnd,
UINT message,
LPARAM lParam,
WPARAM wParam)
{

oh yeah and I think the lParam is always 0 and wParam is way out there (the escape key equaled 65537)


Retired Pokemon Master of Prgramming Problems

I already had them all.

Share this post


Link to post
Share on other sites
Swap the LPARAM and the WPARAM.

i.e.
LRESULT CALLBACK WndProc( HWND hWnd,
UINT message,
LPARAM lParam,
WPARAM wParam)

becomes

LRESULT CALLBACK WndProc( HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam)

Thats the only problem I can think of, only seeing the prototype.

-Mezz

Share this post


Link to post
Share on other sites
Wanna hear something really messed up, when I switched it and compiled it, my program would no longer start, it would go for a millisecond then it''s gone (by millisecond I really mean millisecond, all I get is a flash of the mouse to the hourglass and back).. This is turning wierd, my computer really must hate me or something.

Retired Pokemon Master of Prgramming Problems

I already had them all.

Share this post


Link to post
Share on other sites
Found more on the problem, when I swithc the l/wParam I get an error with CreateWindowEX, the error mesage returned is
"A DLL initialization routine failed". Why is the question. That is the only thing I changed.

Retired Pokemon Master of Prgramming Problems

I already had them all.

Share this post


Link to post
Share on other sites