From 51d67574ecae4a7e898a854b23b79be59197cc4e Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 17 Aug 2006 09:49:43 +0000 Subject: 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 --- documentation/Fl_Gl_Window.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'documentation') 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.

@@ -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 ... } @@ -178,6 +181,14 @@ draw() returns.

void Fl_Gl_Window::invalidate()

The invalidate() method turns off valid() and is equivalent to calling value(0). + +

char Fl_Gl_Window::context_valid() const +
void Fl_Gl_Window::context_valid(char i)

+Fl_Gl_Window::context_valid() will only be set if the +OpenGL context is created or recreated. It differs from +Fl_Gl_Window::valid() which is also set whenever the context +changes size. +

void Fl_Gl_Window::ortho()

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 -- cgit v1.2.3