GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
qopengl-functions.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2018-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_qopengl_functions_h)
27 #define octave_qopengl_functions_h 1
28 
29 #include "oct-opengl.h"
30 
31 #if defined (HAVE_QOPENGLFUNCTIONS_1_1)
32 # include <QOpenGLFunctions_1_1>
33 #endif
34 
35 namespace octave
36 {
37  // If we don't have QOPENGLFUNCTIONS_1_1, then we will default to
38  // calling OpenGL functions directly through the base
39  // opengl_functions class.
40 
42  {
43  public:
44 
46 #if defined (HAVE_QOPENGLFUNCTIONS_1_1)
47  : m_glfcns ()
48 #endif
49  { }
50 
52 
54 
55  ~qopengl_functions (void) = default;
56 
57  void init (void)
58  {
59 #if defined (HAVE_QOPENGLFUNCTIONS_1_1)
60  m_glfcns.initializeOpenGLFunctions ();
61 #endif
62  }
63 
64 #if defined (HAVE_QOPENGLFUNCTIONS_1_1)
65 
66  void glAlphaFunc (GLenum func, GLclampf ref)
67  {
68  m_glfcns.glAlphaFunc (func, ref);
69  }
70 
71  void glBegin (GLenum mode)
72  {
73  m_glfcns.glBegin (mode);
74  }
75 
76  void glBindTexture (GLenum target, GLuint texture)
77  {
78  m_glfcns.glBindTexture (target, texture);
79  }
80 
81  void glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
82  GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
83  {
84  m_glfcns.glBitmap (width, height, xorig, yorig, xmove, ymove, bitmap);
85  }
86 
87  void glBlendFunc (GLenum sfactor, GLenum dfactor)
88  {
89  m_glfcns.glBlendFunc (sfactor, dfactor);
90  }
91 
92  void glCallList (GLuint list)
93  {
94  m_glfcns.glCallList (list);
95  }
96 
97  void glClearColor (GLclampf red, GLclampf green, GLclampf blue,
98  GLclampf alpha)
99  {
100  m_glfcns.glClearColor (red, green, blue, alpha);
101  }
102 
103  void glClear (GLbitfield mask)
104  {
105  m_glfcns.glClear (mask);
106  }
107 
108  void glClipPlane (GLenum plane, const GLdouble *equation)
109  {
110  m_glfcns.glClipPlane (plane, equation);
111  }
112 
113  void glColor3dv (const GLdouble *v)
114  {
115  m_glfcns.glColor3dv (v);
116  }
117 
118  void glColor3f (GLfloat red, GLfloat green, GLfloat blue)
119  {
120  m_glfcns.glColor3f (red, green, blue);
121  }
122 
123  void glColor3fv (const GLfloat *v)
124  {
125  m_glfcns.glColor3fv (v);
126  }
127 
128  void glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
129  {
130  m_glfcns.glColor4d (red, green, blue, alpha);
131  }
132 
133  void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
134  {
135  m_glfcns.glColor4f (red, green, blue, alpha);
136  }
137 
138  void glColor4fv (const GLfloat *v)
139  {
140  m_glfcns.glColor4fv (v);
141  }
142 
143  void glDeleteLists (GLuint list, GLsizei range)
144  {
145  m_glfcns.glDeleteLists (list, range);
146  }
147 
148  void glDeleteTextures (GLsizei n, const GLuint *textures)
149  {
150  m_glfcns.glDeleteTextures (n, textures);
151  }
152 
153  void glDepthFunc (GLenum func)
154  {
155  m_glfcns.glDepthFunc (func);
156  }
157 
158  void glDisable (GLenum cap)
159  {
160  m_glfcns.glDisable (cap);
161  }
162 
163  void glDrawPixels (GLsizei width, GLsizei height, GLenum format,
164  GLenum type, const GLvoid *pixels)
165  {
166  m_glfcns.glDrawPixels (width, height, format, type, pixels);
167  }
168 
169  void glEdgeFlag (GLboolean flag)
170  {
171  m_glfcns.glEdgeFlag (flag);
172  }
173 
174  void glEnable (GLenum cap)
175  {
176  m_glfcns.glEnable (cap);
177  }
178 
179  void glEndList (void)
180  {
181  m_glfcns.glEndList ();
182  }
183 
184  void glEnd (void)
185  {
186  m_glfcns.glEnd ();
187  }
188 
189  void glFinish (void)
190  {
191  m_glfcns.glFinish ();
192  }
193 
194  GLuint glGenLists (GLsizei range)
195  {
196  return m_glfcns.glGenLists (range);
197  }
198 
199  void glGenTextures (GLsizei n, GLuint *textures)
200  {
201  m_glfcns.glGenTextures (n, textures);
202  }
203 
204  void glGetBooleanv (GLenum pname, GLboolean *data)
205  {
206  m_glfcns.glGetBooleanv (pname, data);
207  }
208 
209  void glGetDoublev (GLenum pname, GLdouble *data)
210  {
211  m_glfcns.glGetDoublev (pname, data);
212  }
213 
214  GLenum glGetError (void)
215  {
216  return m_glfcns.glGetError ();
217  }
218 
219  void glGetFloatv (GLenum pname, GLfloat *data)
220  {
221  m_glfcns.glGetFloatv (pname, data);
222  }
223 
224  void glGetIntegerv (GLenum pname, GLint *data)
225  {
226  m_glfcns.glGetIntegerv (pname, data);
227  }
228 
229  const GLubyte * glGetString (GLenum name)
230  {
231  return m_glfcns.glGetString (name);
232  }
233 
234  void glHint (GLenum target, GLenum mode)
235  {
236  m_glfcns.glHint (target, mode);
237  }
238 
239  void glInitNames (void)
240  {
241  m_glfcns.glInitNames ();
242  }
243 
244  GLboolean glIsEnabled (GLenum cap)
245  {
246  return m_glfcns.glIsEnabled (cap);
247  }
248 
249  void glLightfv (GLenum light, GLenum pname, const GLfloat *params)
250  {
251  m_glfcns.glLightfv (light, pname, params);
252  }
253 
254  void glLineStipple (GLint factor, GLushort pattern)
255  {
256  m_glfcns.glLineStipple (factor, pattern);
257  }
258 
259  void glLineWidth (GLfloat width)
260  {
261  m_glfcns.glLineWidth (width);
262  }
263 
264  void glLoadIdentity (void)
265  {
266  m_glfcns.glLoadIdentity ();
267  }
268 
269  void glMaterialf (GLenum face, GLenum pname, GLfloat param)
270  {
271  m_glfcns.glMaterialf (face, pname, param);
272  }
273 
274  void glMaterialfv (GLenum face, GLenum pname, const GLfloat *params)
275  {
276  m_glfcns.glMaterialfv (face, pname, params);
277  }
278 
279  void glMatrixMode (GLenum mode)
280  {
281  m_glfcns.glMatrixMode (mode);
282  }
283 
284  void glMultMatrixd (const GLdouble *m)
285  {
286  m_glfcns.glMultMatrixd (m);
287  }
288 
289  void glNewList (GLuint list, GLenum mode)
290  {
291  m_glfcns.glNewList (list, mode);
292  }
293 
294  void glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz)
295  {
296  m_glfcns.glNormal3d (nx, ny, nz);
297  }
298 
299  void glNormal3dv (const GLdouble *v)
300  {
301  m_glfcns.glNormal3dv (v);
302  }
303 
304  void glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top,
305  GLdouble near_val, GLdouble far_val)
306  {
307  m_glfcns.glOrtho (left, right, bottom, top, near_val, far_val);
308  }
309 
310  void glPixelStorei (GLenum pname, GLint param)
311  {
312  m_glfcns.glPixelStorei (pname, param);
313  }
314 
315  void glPixelZoom (GLfloat xfactor, GLfloat yfactor)
316  {
317  m_glfcns.glPixelZoom (xfactor, yfactor);
318  }
319 
320  void glPolygonMode (GLenum face, GLenum mode)
321  {
322  m_glfcns.glPolygonMode (face, mode);
323  }
324 
325  void glPolygonOffset (GLfloat factor, GLfloat units)
326  {
327  m_glfcns.glPolygonOffset (factor, units);
328  }
329 
330  void glPopAttrib (void)
331  {
332  m_glfcns.glPopAttrib ();
333  }
334 
335  void glPopMatrix (void)
336  {
337  m_glfcns.glPopMatrix ();
338  }
339 
340  void glPopName (void)
341  {
342  m_glfcns.glPopName ();
343  }
344 
345  void glPushAttrib (GLbitfield mask)
346  {
347  m_glfcns.glPushAttrib (mask);
348  }
349 
350  void glPushMatrix (void)
351  {
352  m_glfcns.glPushMatrix ();
353  }
354 
355  void glPushName (GLuint name)
356  {
357  m_glfcns.glPushName (name);
358  }
359 
360  void glRasterPos3d (GLdouble x, GLdouble y, GLdouble z)
361  {
362  m_glfcns.glRasterPos3d (x, y, z);
363  }
364 
365  void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height,
366  GLenum format, GLenum type, GLvoid *pixels)
367  {
368  m_glfcns.glReadPixels (x, y, width, height, format, type, pixels);
369  }
370 
371  GLint glRenderMode (GLenum mode)
372  {
373  return m_glfcns.glRenderMode (mode);
374  }
375 
376  void glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
377  {
378  m_glfcns.glRotated (angle, x, y, z);
379  }
380 
381  void glScaled (GLdouble x, GLdouble y, GLdouble z)
382  {
383  m_glfcns.glScaled (x, y, z);
384  }
385 
386  void glScalef (GLfloat x, GLfloat y, GLfloat z)
387  {
388  m_glfcns.glScalef (x, y, z);
389  }
390 
391  void glSelectBuffer (GLsizei size, GLuint *buffer)
392  {
393  m_glfcns.glSelectBuffer (size, buffer);
394  }
395 
396  void glShadeModel (GLenum mode)
397  {
398  m_glfcns.glShadeModel (mode);
399  }
400 
401  void glTexCoord2d (GLdouble s, GLdouble t)
402  {
403  m_glfcns.glTexCoord2d (s, t);
404  }
405 
406  void glTexImage2D (GLenum target, GLint level, GLint internalFormat,
407  GLsizei width, GLsizei height, GLint border,
408  GLenum format, GLenum type, const GLvoid *pixels)
409  {
410  m_glfcns.glTexImage2D (target, level, internalFormat, width, height,
411  border, format, type, pixels);
412  }
413 
414  void glTexParameteri (GLenum target, GLenum pname, GLint param)
415  {
416  m_glfcns.glTexParameteri (target, pname, param);
417  }
418 
419  void glTranslated (GLdouble x, GLdouble y, GLdouble z)
420  {
421  m_glfcns.glTranslated (x, y, z);
422  }
423 
424  void glTranslatef (GLfloat x, GLfloat y, GLfloat z)
425  {
426  m_glfcns.glTranslatef (x, y, z);
427  }
428 
429  void glVertex2d (GLdouble x, GLdouble y)
430  {
431  m_glfcns.glVertex2d (x, y);
432  }
433 
434  void glVertex3d (GLdouble x, GLdouble y, GLdouble z)
435  {
436  m_glfcns.glVertex3d (x, y, z);
437  }
438 
439  void glVertex3dv (const GLdouble *v)
440  {
441  m_glfcns.glVertex3dv (v);
442  }
443 
444  void glViewport (GLint x, GLint y, GLsizei width, GLsizei height)
445  {
446  m_glfcns.glViewport (x, y, width, height);
447  }
448 
449  private:
450 
451  QOpenGLFunctions_1_1 m_glfcns;
452 
453 #endif
454  };
455 }
456 
457 #endif
virtual void glBindTexture(GLenum target, GLuint texture)
Definition: oct-opengl.h:83
virtual void glGetDoublev(GLenum pname, GLdouble *data)
Definition: oct-opengl.h:219
virtual void glScalef(GLfloat x, GLfloat y, GLfloat z)
Definition: oct-opengl.h:396
virtual void glPolygonMode(GLenum face, GLenum mode)
Definition: oct-opengl.h:330
virtual void glMultMatrixd(const GLdouble *m)
Definition: oct-opengl.h:294
virtual void glEnd(void)
Definition: oct-opengl.h:194
virtual void glBegin(GLenum mode)
Definition: oct-opengl.h:78
virtual void glDisable(GLenum cap)
Definition: oct-opengl.h:168
virtual void glNormal3dv(const GLdouble *v)
Definition: oct-opengl.h:309
virtual void glSelectBuffer(GLsizei size, GLuint *buffer)
Definition: oct-opengl.h:401
virtual void glGenTextures(GLsizei n, GLuint *textures)
Definition: oct-opengl.h:209
virtual void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
Definition: oct-opengl.h:105
virtual void glPolygonOffset(GLfloat factor, GLfloat units)
Definition: oct-opengl.h:335
virtual void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val)
Definition: oct-opengl.h:314
virtual void glVertex2d(GLdouble x, GLdouble y)
Definition: oct-opengl.h:439
virtual void glDepthFunc(GLenum func)
Definition: oct-opengl.h:163
virtual void glPixelStorei(GLenum pname, GLint param)
Definition: oct-opengl.h:320
virtual void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
Definition: oct-opengl.h:88
virtual void glColor3dv(const GLdouble *v)
Definition: oct-opengl.h:121
virtual void glLineStipple(GLint factor, GLushort pattern)
Definition: oct-opengl.h:264
virtual void glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
Definition: oct-opengl.h:136
virtual void glShadeModel(GLenum mode)
Definition: oct-opengl.h:406
virtual void glMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
Definition: oct-opengl.h:284
virtual void glAlphaFunc(GLenum func, GLclampf ref)
Definition: oct-opengl.h:73
virtual void glBlendFunc(GLenum sfactor, GLenum dfactor)
Definition: oct-opengl.h:95
virtual void glGetIntegerv(GLenum pname, GLint *data)
Definition: oct-opengl.h:234
virtual void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
Definition: oct-opengl.h:375
virtual const GLubyte * glGetString(GLenum name)
Definition: oct-opengl.h:239
virtual GLboolean glIsEnabled(GLenum cap)
Definition: oct-opengl.h:254
virtual void glDeleteTextures(GLsizei n, const GLuint *textures)
Definition: oct-opengl.h:158
virtual void glClipPlane(GLenum plane, const GLdouble *equation)
Definition: oct-opengl.h:116
virtual void glColor3f(GLfloat red, GLfloat green, GLfloat blue)
Definition: oct-opengl.h:126
virtual GLint glRenderMode(GLenum mode)
Definition: oct-opengl.h:381
virtual void glEdgeFlag(GLboolean flag)
Definition: oct-opengl.h:179
virtual void glPixelZoom(GLfloat xfactor, GLfloat yfactor)
Definition: oct-opengl.h:325
virtual void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
Definition: oct-opengl.h:454
virtual void glPopMatrix(void)
Definition: oct-opengl.h:345
virtual void glScaled(GLdouble x, GLdouble y, GLdouble z)
Definition: oct-opengl.h:391
virtual void glGetBooleanv(GLenum pname, GLboolean *data)
Definition: oct-opengl.h:214
virtual void glLineWidth(GLfloat width)
Definition: oct-opengl.h:269
virtual void glEnable(GLenum cap)
Definition: oct-opengl.h:184
virtual void glPushAttrib(GLbitfield mask)
Definition: oct-opengl.h:355
virtual void glInitNames(void)
Definition: oct-opengl.h:249
virtual void glVertex3d(GLdouble x, GLdouble y, GLdouble z)
Definition: oct-opengl.h:444
virtual void glDeleteLists(GLuint list, GLsizei range)
Definition: oct-opengl.h:153
virtual void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
Definition: oct-opengl.h:416
virtual void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
Definition: oct-opengl.h:173
virtual void glCallList(GLuint list)
Definition: oct-opengl.h:100
virtual GLuint glGenLists(GLsizei range)
Definition: oct-opengl.h:204
virtual void glEndList(void)
Definition: oct-opengl.h:189
virtual void glLoadIdentity(void)
Definition: oct-opengl.h:274
virtual void glNewList(GLuint list, GLenum mode)
Definition: oct-opengl.h:299
virtual void glTranslated(GLdouble x, GLdouble y, GLdouble z)
Definition: oct-opengl.h:429
virtual void glFinish(void)
Definition: oct-opengl.h:199
virtual void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
Definition: oct-opengl.h:142
virtual void glRasterPos3d(GLdouble x, GLdouble y, GLdouble z)
Definition: oct-opengl.h:370
virtual void glPopAttrib(void)
Definition: oct-opengl.h:340
virtual void glGetFloatv(GLenum pname, GLfloat *data)
Definition: oct-opengl.h:229
virtual GLenum glGetError(void)
Definition: oct-opengl.h:224
virtual void glHint(GLenum target, GLenum mode)
Definition: oct-opengl.h:244
virtual void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
Definition: oct-opengl.h:386
virtual void glPopName(void)
Definition: oct-opengl.h:350
virtual void glMaterialf(GLenum face, GLenum pname, GLfloat param)
Definition: oct-opengl.h:279
virtual void glMatrixMode(GLenum mode)
Definition: oct-opengl.h:289
virtual void glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz)
Definition: oct-opengl.h:304
virtual void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
Definition: oct-opengl.h:434
virtual void glColor3fv(const GLfloat *v)
Definition: oct-opengl.h:131
virtual void glColor4fv(const GLfloat *v)
Definition: oct-opengl.h:148
virtual void glPushMatrix(void)
Definition: oct-opengl.h:360
virtual void glTexCoord2d(GLdouble s, GLdouble t)
Definition: oct-opengl.h:411
virtual void glPushName(GLuint name)
Definition: oct-opengl.h:365
virtual void glTexParameteri(GLenum target, GLenum pname, GLint param)
Definition: oct-opengl.h:424
virtual void glClear(GLbitfield mask)
Definition: oct-opengl.h:111
virtual void glVertex3dv(const GLdouble *v)
Definition: oct-opengl.h:449
virtual void glLightfv(GLenum light, GLenum pname, const GLfloat *params)
Definition: oct-opengl.h:259
qopengl_functions(const qopengl_functions &)=default
~qopengl_functions(void)=default
qopengl_functions & operator=(const qopengl_functions &)=default
QString name
F77_RET_T const F77_DBLE * x
T octave_idx_type m
Definition: mx-inlines.cc:773
octave_idx_type n
Definition: mx-inlines.cc:753
static int left
Definition: randmtzig.cc:191
size_t format(std::ostream &os, const char *fmt,...)
Definition: utils.cc:1329