diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-08-17 09:49:43 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-08-17 09:49:43 +0000 |
| commit | 51d67574ecae4a7e898a854b23b79be59197cc4e (patch) | |
| tree | a40de38ebf1471fca6f68181b107eba5719de5c2 /documentation/Fl_Gl_Window.html | |
| parent | ef48f007a1a8463abfccb118a6836718d497eb29 (diff) | |
New context_changed() function for OpenGL windows allowing efficient texture loading (str #1372)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5322 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation/Fl_Gl_Window.html')
| -rw-r--r-- | documentation/Fl_Gl_Window.html | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/documentation/Fl_Gl_Window.html b/documentation/Fl_Gl_Window.html index 2367cbcdb..5ad853d7a 100644 --- a/documentation/Fl_Gl_Window.html +++ b/documentation/Fl_Gl_Window.html @@ -58,6 +58,7 @@ unless those Widgets are modified to draw using OpenGL calls.</P> </TD><TD align=left valign=top> <UL> <LI><A href=#Fl_Gl_Window.context>context</A></LI> +<LI><A href=#Fl_Gl_Window.context_valid>context_valid</A></LI> <LI><A href=#Fl_Gl_Window.draw>draw</A></LI> <LI><A href=#Fl_Gl_Window.draw_overlay>draw_overlay</A></LI> </UL> @@ -164,9 +165,11 @@ void mywindow::draw() { if (!valid()) { glViewport(0,0,w(),h()); glFrustum(...); - glLight(...); ...other initialization... } + if (!context_valid()) { + ...load textures, etc. ... + } ... draw your geometry here ... } </PRE></UL> @@ -178,6 +181,14 @@ draw()</TT> returns. <H4><A name=Fl_Gl_Window.invalidate>void Fl_Gl_Window::invalidate()</A></H4> The <TT>invalidate()</TT> method turns off <TT>valid()</TT> and is equivalent to calling <TT>value(0)</TT>. + +<H4><A name=Fl_Gl_Window.context_valid>char Fl_Gl_Window::context_valid() const +<BR> void Fl_Gl_Window::context_valid(char i)</A></H4> +<TT>Fl_Gl_Window::context_valid()</TT> will only be set if the +OpenGL context is created or recreated. It differs from +<TT>Fl_Gl_Window::valid()</TT> which is also set whenever the context +changes size. + <H4><A name=Fl_Gl_Window.ortho>void Fl_Gl_Window::ortho()</A></H4> Set the projection so 0,0 is in the lower left of the window and each pixel is 1 unit wide/tall. If you are drawing 2D images, your <TT> |
