Advertisement

Moving & ReSizing Windows

Started by June 29, 2003 10:03 PM
5 comments, last by The Lion King 21 years, 8 months ago
Hi, I can't move or resize my window according to Tutorial No.1 It just doesn't move. I am using WinXP and Visual Studio .NET Any suggestions ? Thanks ... I can survive anything ... even NUKES!!! The Lion King [edited by - The Lion King on June 30, 2003 2:26:52 AM]
I had exactly the same problem when I was starting out and somehow I got it to work right. I''m not sure where the problem was but I think it was in the loop in WinMain...inside:
while(!done)
{
//blah
}
Compare that part of your code with NeHe''s, if you don''t find anything there you can try taking a look inside WndProc() there might be something wrong there. I hate when I solve a problem and don''t know how the hell I did it...not that it happens to me everyday...

--------------------------------------------------------
The monkeys are listening...
The monkeys are listening...
Advertisement
Hi,

I don''t know if there is anything to do with Main Loop in WinMain () or there is?

I checked my WndProc () and it says OK. WM_SIZE contains ResizeGL(). The only difference was that, I have got a break; after the case statements not return 0; like the NeHe''s.

The other thing that differs is that I have a default with return to DefWndProc () and return true; in the end. But I even changed it by removing default and adding return DefWndProc() instead of return true; But it doesn''t work even now.

Please help ... !!!

I can survive anything ... even NUKES!!!

The Lion King
Ok first off try not to mess around too much with the WndProc(), try to make it as close as posible to NeHe''s lesson (you can modify it later if the code works). As for the other part of the code check it with this (it''s almost exactly the same as NeHe''s and it works):
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,                   LPSTR lpStr,int nCmdShow){    MSG msg;    BOOL done =FALSE;        if(!CreateGLWindow("Blah",                   800,600,24,false))    {     //handle error    }        while (!done)    {       if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))       {         if (msg.message == WM_QUIT) done = TRUE;          else          {           TranslateMessage(&msg);           DispatchMessage(&msg);          }       }else       {        DrawGLScene();        SwapBuffers(hDC);       }    }    KillGLWindow();    return msg.wParam;}


If you don''t find any problems with this check the initialization code there might be a mistake somewhere.
When you find the solution to this problem please tell me
I''d like to find out what I was doing wrong...

--------------------------------------------------------
The monkeys are listening...
The monkeys are listening...
It worked fine for me, using XP pro... and I didnt just download the sample-code. But you could try running that code, and see if it works. If it does, you made a typo
quote:

It worked fine for me, using XP pro... and I didnt just download the sample-code. But you could try running that code, and see if it works. If it does, you made a typo



I''m also using XP pro and I was having that problem when I started out. Even though I can''t remember I think the error lies somewhere in the code I indicated before. I''m pretty sure the problem isn''t with XP though...personally I would go through the whole tutorial checking the code to see any mistakes I made...


--------------------------------------------------------
The monkeys are listening...
The monkeys are listening...
Advertisement
I am in the office right now. I think the difference is in my PeekMessage ().

Anyway I''ll check in the evening ...

Thanks ...

I can survive anything ... even NUKES!!!

The Lion King

This topic is closed to new replies.

Advertisement