render in child (winapi&opengl)

Started by
4 comments, last by SnuuT 21 years, 7 months ago
how you read in the topic i want to render in a child window. but it doesn't work like i want. i call glClear, and after this, the window should be black, shouldn't it? but in my case, the window isn't black at all, there is also a region that has the default backgroundcolor, like the other windows. it seems like this region of the window isn't cleared (?). here's a screen, maybe you now know better what i tried to explain. http://www.cevi-buchsi.ch/screen.jpg source: http://www.cevi-buchsi.ch/main.cpp thx 4 help & sry 4 my english [edited by - SnuuT on August 26, 2002 6:55:56 AM]
Advertisement
Make sure you put CS_OWNDC in the window class flags (with CS_HREDRAW) not when you create your window.

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
hm...this doesn''t help, thx anyway. i have no idea, where the problem is.
1. Your desktop colors are really ugly
2. Are you sure you use the right DC in wglCreateContext? It should be that of the child, the same goes for SetPixelFormat, wglMakeCurrent etc...
3. Are you using GL_SCISSOR_TEST ? Scissor affects glClear.
so...i solved it with glScissor. it works, but now, i wan''t to know what i''ve to do that in the top left corner of the scissor has the coordinates (0, 0) and the bottom right corner has the coordinates (800, 600). with glViewport i didn''t get it running like i wan''t, is there any other possibility ?

btw: why''s my windows'' bgcolor green? i know it''s cause of glScissor but why is it? actually i don''t care, so it doesn''t matter...
*push* thx 4 any help

This topic is closed to new replies.

Advertisement