2 * Copyright (C) 2006 Claudio Ciccani <klan@users.sf.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 glutGet( GLenum type
)
34 if (g_current
&& g_current
->window
) {
36 g_current
->window
->GetPosition( g_current
->window
, &x
, 0 );
41 if (g_current
&& g_current
->window
) {
43 g_current
->window
->GetPosition( g_current
->window
, 0, &y
);
48 case GLUT_WINDOW_WIDTH
:
51 g_current
->surface
->GetSize( g_current
->surface
, &w
, 0 );
55 case GLUT_WINDOW_HEIGHT
:
58 g_current
->surface
->GetSize( g_current
->surface
, 0, &h
);
63 case GLUT_WINDOW_BUFFER_SIZE
:
66 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
70 case GLUT_WINDOW_STENCIL_SIZE
:
73 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
74 return a
.stencil_size
;
77 case GLUT_WINDOW_DEPTH_SIZE
:
80 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
84 case GLUT_WINDOW_RED_SIZE
:
87 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
91 case GLUT_WINDOW_GREEN_SIZE
:
94 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
98 case GLUT_WINDOW_BLUE_SIZE
:
101 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
105 case GLUT_WINDOW_ALPHA_SIZE
:
108 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
112 case GLUT_WINDOW_ACCUM_RED_SIZE
:
115 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
116 return a
.accum_red_size
;
119 case GLUT_WINDOW_ACCUM_GREEN_SIZE
:
122 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
123 return a
.accum_green_size
;
126 case GLUT_WINDOW_ACCUM_BLUE_SIZE
:
129 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
130 return a
.accum_blue_size
;
133 case GLUT_WINDOW_ACCUM_ALPHA_SIZE
:
136 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
137 return a
.accum_alpha_size
;
140 case GLUT_WINDOW_DOUBLEBUFFER
:
143 g_current
->gl
->GetAttributes( g_current
->gl
, &a
);
144 return a
.double_buffer
;
148 case GLUT_WINDOW_RGBA
:
151 case GLUT_WINDOW_CURSOR
:
153 return g_current
->cursor
;
156 case GLUT_SCREEN_WIDTH
:
158 DFBDisplayLayerConfig c
;
159 primary
->GetConfiguration( primary
, &c
);
163 case GLUT_SCREEN_HEIGHT
:
165 DFBDisplayLayerConfig c
;
166 primary
->GetConfiguration( primary
, &c
);
171 case GLUT_INIT_DISPLAY_MODE
:
172 return g_display_mode
;
173 case GLUT_INIT_WINDOW_X
:
175 case GLUT_INIT_WINDOW_Y
:
177 case GLUT_INIT_WINDOW_WIDTH
:
179 case GLUT_INIT_WINDOW_HEIGHT
:
182 case GLUT_ELAPSED_TIME
:
184 static long long start
= -1;
187 gettimeofday( &t
, NULL
);
189 start
= t
.tv_sec
* 1000ll + t
.tv_usec
/ 1000ll;
192 return (t
.tv_sec
* 1000ll + t
.tv_usec
/ 1000ll - start
);
205 glutLayerGet( GLenum type
)
211 glutReportErrors( void )
215 while ((error
= glGetError()) != GL_NO_ERROR
)
216 __glutWarning( "**OpenGL Error** %s", gluErrorString( error
) );