From 38fc80aef7954a18c0b91e38fedd32324a9e0c39 Mon Sep 17 00:00:00 2001
From: Ryan Norton <wxprojects@comcast.net>
Date: Thu, 23 Sep 2004 19:01:20 +0000
Subject: [PATCH] wxGLContext docs, tidy up of some wxGLCanvas docs, add
 wxGLContext to classes list, and add gl classes to misc category

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/category.tex  |  2 ++
 docs/latex/wx/classes.tex   |  1 +
 docs/latex/wx/glcanvas.tex  |  6 +++-
 docs/latex/wx/glcontext.tex | 61 +++++++++++++++++++++++++++++++++++++
 4 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 docs/latex/wx/glcontext.tex

diff --git a/docs/latex/wx/category.tex b/docs/latex/wx/category.tex
index f32ccb78da..338978388d 100644
--- a/docs/latex/wx/category.tex
+++ b/docs/latex/wx/category.tex
@@ -605,6 +605,8 @@ product, donated by Remstar. This is known as wxODBC.
 \twocolitem{\helpref{wxCmdLineParser}{wxcmdlineparser}}{Command line parser class}
 \twocolitem{\helpref{wxConfig}{wxconfigbase}}{Classes for configuration reading/writing (using either INI files or registry)}
 \twocolitem{\helpref{wxDllLoader}{wxdllloader}}{Class to work with shared libraries.}
+\twocolitem{\helpref{wxGLCanvas}{wxglcanvas}}{Canvas that you can render opengl calls to.}
+\twocolitem{\helpref{wxGLContext}{wxglcontext}}{Class to ease sharing of opengl data resources.}
 \twocolitem{\helpref{wxLayoutAlgorithm}{wxlayoutalgorithm}}{An alternative window layout facility}
 \twocolitem{\helpref{wxProcess}{wxprocess}}{Process class}
 \twocolitem{\helpref{wxTimer}{wxtimer}}{Timer class}
diff --git a/docs/latex/wx/classes.tex b/docs/latex/wx/classes.tex
index b9d1e08456..abc7ae3218 100644
--- a/docs/latex/wx/classes.tex
+++ b/docs/latex/wx/classes.tex
@@ -127,6 +127,7 @@
 \input dirctrl.tex
 \input valgen.tex
 \input glcanvas.tex
+\input glcontext.tex
 \input grid.tex
 \input gridattr.tex
 \input gridbagsizer.tex
diff --git a/docs/latex/wx/glcanvas.tex b/docs/latex/wx/glcanvas.tex
index a2f1abad3d..1476dffe34 100644
--- a/docs/latex/wx/glcanvas.tex
+++ b/docs/latex/wx/glcanvas.tex
@@ -57,6 +57,10 @@ alpha channel, and accum buffer. Other implementations may support them.
 \twocolitem{\windowstyle{WX\_GL\_MIN\_ACCUM\_ALPHA}}{Use blue buffer with most bits (> MIN\_ACCUM\_ALPHA bits)}
 \end{twocollist}
 
+\wxheading{See Also}
+
+\helpref{wxGLContext}{wxglcontext}
+
 \latexignore{\rtfignore{\wxheading{Members}}}
 
 \membersection{wxGLCanvas::wxGLCanvas}\label{wxglcanvasconstr}
@@ -117,7 +121,7 @@ Obtains the context that is associated with this canvas.
 \func{void}{SetCurrent}{\void}
 
 Sets this canvas as the current recipient of OpenGL calls.
-Each canvas contain an OpenGL device context that has been created during
+Each canvas contains an OpenGL device context that has been created during
 the creation of this window. So this call sets the current device context
 as the target device context for OpenGL operations.
 
diff --git a/docs/latex/wx/glcontext.tex b/docs/latex/wx/glcontext.tex
new file mode 100644
index 0000000000..c272127cc2
--- /dev/null
+++ b/docs/latex/wx/glcontext.tex
@@ -0,0 +1,61 @@
+\section{\class{wxGLContext}}\label{wxglcontext}
+
+wxGLContext is a class for sharing opengl data resources, such as display lists, with another \helpref{wxGLCanvas}{wxglcanvas}.
+
+By sharing data resources, you can prevent code duplication, save memory, and ultimately help optimize your application.
+
+As an example, let's say you want to draw a ball on two different windows that is identical on each one, but the dimensions of one is slightly different than the other one.  What you would do is create your display lists in the shared canvas, and then translate each ball on the individual canvas's context.  This way the actual data for the ball is only created once (in the shared context), and you won't have to duplicate your development efforts on the second ball.
+
+Note that some wxGLContext features are extremely platform-specific - its best to check your native platform's glcanvas header (on windows include/wx/msw/glcanvas.h) to see what features your native platform provides.
+
+\wxheading{Derived from}
+
+\helpref{wxObject}{wxobject}
+
+\wxheading{Include files}
+
+<wx/glcanvas.h>\\
+\\ 
+\wxheading{See Also}
+
+\helpref{wxGLCanvas}{wxglcanvas}
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+\membersection{wxGLContext::wxGLContext}\label{wxglcontextconstr}
+
+\func{void}{wxGLContext}{\param{bool }{isRGB}, \param{wxGLCanvas*}{ win}, \param{const wxPalette\&}{ palette = wxNullPalette}}
+
+\func{void}{wxGLContext}{\param{bool }{isRGB}, \param{wxGLCanvas*}{ win}, \param{const wxPalette\&}{ palette = wxNullPalette},
+ \param{const wxGLContext*}{ other}}
+
+\docparam{win}{Canvas to associate this shared context with.}
+
+\docparam{other}{Context to share data resources with.}
+
+\membersection{wxGLContext::GetWindow}\label{wxglcontextgetwindow}
+
+\func{const wxWindow*}{GetWindow}{\void}
+
+Obtains the window that is associated with this context.
+
+\membersection{wxGLContext::SetCurrent}\label{wxglcontextsetcurrent}
+
+\func{void}{SetCurrent}{\void}
+
+Sets this context as the current recipient of OpenGL calls.
+Each context contains an OpenGL device context that has been created during
+the creation of this window. So this call sets the current device context
+as the target device context for OpenGL operations.
+
+\membersection{wxGLContext::SetColour}\label{wxglcontextsetcolour}
+
+\func{void}{SetColour}{\param{const char*}{ colour}}
+
+Sets the current colour for this context, using the wxWidgets colour database to find a named colour.
+
+\membersection{wxGLContext::SwapBuffers}\label{wxglcontextswapbuffers}
+
+\func{void}{SwapBuffers}{\void}
+
+Displays the previous OpenGL commands on the associated window.
-- 
2.50.0

