but still not working.... no objects appear and the screen are just in black

sebh

12-06-2003, 12:33 PM

I not sure but perhaps render() should be call between BeginPaint(hWnd, &g_ps) and EndPaint(hWnd, &g_ps); ???
No ???

johncsl82

12-06-2003, 08:09 PM

I tried but still won't work....... http://www.opengl.org/discussion_boards/ubb/frown.gif

mikael_aronsson

12-07-2003, 03:51 AM

Does the OpenGL rendering work at all ?, try to set the clearcolor to red or something and run the application, if your window gets red then OpenGL is working fine and the problem is with the matrices possibly...

Mikael

DJSnow

12-07-2003, 06:03 AM

where are your objects located ?
try translating the cam, via glTranslate, that they CAN SEE the objects, it sounds like you are facing into the wrong direction...
as said in the red book: "...the cam is located at the origin and facing downwards the z axis, by default..."

onix

12-07-2003, 08:54 AM

I dont use windows so i cant try this out but you could try putting SwapBuffers() under Render() like this:

{
Render();
SwapBuffers(g_hDc);
}

DJSnow

12-07-2003, 09:28 AM

@author of the thread:
and remove this goofy WM_PAINT message processing with Begin/EndPaint (????).

DJSnow

12-09-2003, 02:42 AM

does it work now ?

johncsl82

12-09-2003, 02:57 AM

hmmmmm.... not working... i tried everything...

mikael_aronsson

12-09-2003, 04:18 AM

Originally posted by DJSnow:
@author of the thread:
and remove this goofy WM_PAINT message processing with Begin/EndPaint (????).

DO NOT REMOVE BeginPaint/EndPaint !!!

If you do windows is going to send WM_PAINT messages up the yazzooo, EndPaint clears an internal flag indicating that the window has ben repainted so no more WM_PAINT messages needs to be sent.

You should only call DefWindowProc when you don't handle the message yourself so you get a default. For example, when a WM_PAINT message gets in, you already take care of the painting, so there is no need to call DefWindowProc because that would draw the default background over the things you painted before...

EDIT: proper code formating is not as easy as it looks http://www.opengl.org/discussion_boards/ubb/wink.gif

[This message has been edited by Overmind (edited 12-09-2003).]

johncsl82

12-10-2003, 05:10 AM

hmmmm..... still not working either

johncsl82

12-11-2003, 03:42 AM

hmmm.... I have solved the problem by deleted the whole file and re-type the same code again http://www.opengl.org/discussion_boards/ubb/frown.gif ....

It this means there is some thing wrong with my compiler.......??? I'm using MVC++ .NET

ok, then i'm wondering why:
1. my code works perfectly without it
2. even the author of "opengl game programming" don't use this ???

but i'm sure that you have an answer !?

12-12-2003, 10:51 AM

>>ok, then i'm wondering why:
>>1. my code works perfectly without it

How does a Win32 Application process window messages without a window proc?

>>2. even the author of "opengl game >>programming" don't use this ???

No? are you sure?

DJSnow

12-13-2003, 05:28 AM

@where am i:
>>How does a Win32 Application process
>>window messages without a window proc?
should i send the source to you ???????????
don't answer: i will send you a small app, with our engine, that you can figure out it for yourself.

apart from that: i stated out "why my program works though" and not "hey, remove the window msg proc." - saying to guy, that he should try removing begin/end paint(), has nothing to do with saying "remove the window msg proc." - where did you get this information from ???

>>No? are you sure?
nearly, 99,9% - yes; although i don't have it by hand, right now yet; i will look into it, when i'm back at my apartment, this evening.