Re: Fw: Splitter window woes.

"Alen Ladavac" <[email protected]>
Newsgroups gmane.games.devel.windows
Message-ID <[email protected]>
I don't know which kind of insecticide is right for your bug, but I can tell
you about another interesting bug... OpenGL on Windows has this specific
problem, where you can only initialize an OGL context for a window once. If
you want to do it again (because you changed display mode, e.g.), you need
to close the window and open a new one. For that kind of bug, you need a
nuke: we wrapped a child window within any window that wanted to have a
context, and make a context in the child. So anytime we want to reinitialize
the context, we just destroy the child and create it again.

As it happens, this kind of nuke also instantly kills all Win32
peciuliarities regarding how different window classes and flags interact
with creation of contexts, both for OpenGL and for D3D. Might want to try it
on yours as well. ;)


HTH,
Alen


----- Original Message -----
From: "Lachlan Littlemore" <[email protected]>
To: "GameDev Windows" <[email protected]>
Sent: Tuesday, July 20, 2004 22:25
Subject: [GD-Windows] Fw: Splitter window woes.


>      Hi all,
>
>      I'm currently working on a level editor tool which uses multiple
>  viewpoints (subclasses of a BASE_GRAPHICS class) to show different
>  perspectives on the level. I have a splitter window which has two panes
in
>  it. One for the viewpoint(s) and another for the tool-panel dialog. The
> user
>  can toggle between having just one viewpoint in the viewpoint pane, or
>  splitting it into 4 smaller ones (each with individual views), which
>  involves using a nested splitter. At any time, the user can pick a
> different
>  viewpoint (perspective, various orthogonal ones etc) from comboboxes on
the
>  tools dialog to change to a different view. This involves calling
>  deleteView() on the pane and then a createView() with the new viewing
> class.
>  If the user toggles between split and single viewpoints, I have to call
>  deleteView on all the views, delete the nested splitter and create a
single
>  view (and vice-versa for going from single view to multi).
>
>      This is all working *fairly* fine, except that for some reason, the
>  first view (top-left in the 2 x 2 nested splitter) does not draw properly
>  once you try to delete and re-create it. It works fine on application
>  start-up, but if you try to change the viewpoint or un-split, then
re-split
>  the view, it just renders black. Looking at debugging output, I can see
> that
>  in the function which re-splits the views, the other 3 views haven't had
>  their windows created or Direct3D devices initialised (meaning their
> windows
>  haven't been initialised yet), but the first view has valid data in it,
> like
>  it wasn't ever deleted. This is very strange, as I'm deleting the
splitter
>  object itself when I un-split the view (otherwise I get an assertion for
>  having views that don't have any windows created for them). Does anyone
> know
>  of any behaviour that is specific to the first view in a splitter? The
pane
>  in question does redraw, it just draws a black background though (perhaps
> an
>  initialisation function is not being called?).
>
>      Thanks in advance,
>
>      - Lachlan
>
>      P.S. I have a hunch that the reason it works fine on app startup is
>  because the views are initially created in an OnCreateClient() call,
which
>  has a valid CCreateContext member to use for their creation. The other
>  functions are called by me directly, so they have no such luxury. I have
>  tried fabricating my own CCreateContext with any combination of valid
data
> I
>  can find (GetActiveDocument(), the dynamic class to be used for the view,
a
>  pointer to the document template, etc), but in that case, the window
> doesn't
>  even refresh!
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> Gamedevlists-windows mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_id=555
>



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=555
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.