/usr/include/BALL/VIEW/RENDERING/glRenderWindow.h is in libballview1.4-dev 1.4.3~beta1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | // -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_RENDERING_GLRENDERWINDOW_H
#define BALL_VIEW_RENDERING_GLRENDERWINDOW_H
#ifndef BALL_COMMON_GLOBAL_H
# include <BALL/COMMON/global.h>
#endif
#ifndef BALL_DATATYPE_STRING_H
# include <BALL/DATATYPE/string.h>
#endif
#ifndef BALL_VIEW_RENDERING_RENDERWINDOW_H
# include <BALL/VIEW/RENDERING/renderWindow.h>
#endif
#ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
# include <BALL/VIEW/DATATYPE/colorRGBA.h>
#endif
#ifndef BALL_SYSTEM_MUTEX_H
# include <BALL/SYSTEM/mutex.h>
#endif
#include <QtOpenGL/qgl.h>
namespace BALL
{
namespace VIEW
{
/**
* Model of the \link RenderWindow \endlink which uses OpenGL to render its buffer to the screen
*/
class BALL_VIEW_EXPORT GLRenderWindow
: public RenderWindow,
public QGLWidget
{
public:
GLRenderWindow();
GLRenderWindow(QWidget* parent_widget, const char* name = NULL, Qt::WFlags w_flags = 0);
GLRenderWindow(const GLRenderWindow& window, QWidget* parent_widget, const char* name = NULL, Qt::WFlags w_flags = 0);
virtual ~GLRenderWindow();
/* RenderWindow methods */
virtual bool init();
virtual bool resize(const unsigned int width, const unsigned int height);
virtual void refresh();
// render the given text in the given color and size at window coordinates (x, y)
virtual void renderText(int x, int y, const String& text, const ColorRGBA& color, Size size = 16);
// render the given text in the given color and size at world coordinates (x, y, z)
virtual void renderText(float x, float y, float z, const String& text, const ColorRGBA& color, Size size = 16);
/// Lock the context for the current thread and make it active
void lockGLContext();
/// Unlock the context for the current thread and make it active
void unlockGLContext();
/// Force the window to ignore paint events
void ignoreEvents(bool ignore) {ignore_events_ = ignore;}
/// Set the window's downsampling factor. This is a speed up factor.
void setDownsamplingFactor(float dsfactor)
{down_sampling_factor_ = dsfactor;}
/// Set the stereo delta for raytracing in pixels.
void setStereoDelta(float delta)
{stereo_delta_ = delta;}
void setupStereo(float eye_separation, float focal_length);
/// Get the window's downsampling factor.
float getDownsamplingFactor() const
{return down_sampling_factor_;}
float stereo_delta_;
protected:
/** This function handles custom Qt Events.
*
* The main use of this function is notification of a fresh buffer to
* display from a separate renderer thread.
*/
virtual void customEvent(QEvent* evt);
void paintEvent(QPaintEvent* e);
static QGLFormat gl_format_;
// ID of the fullscreen texture used to paste image into GPU framebuffer
GLuint m_screenTexID;
// type of the texture used
GLenum FB_TEXTURE_TARGET;
// format of the GL texture (GL_RGB, GL_RGBA, etc.)
GLenum FB_TEXTURE_FORMAT;
// internal format specified when creating the textures
GLenum FB_INTERNAL_TEXTURE_FORMAT;
// data type of the GL texture (GL_FLOAT, GL_UNSIGNED_INT, etc.)
GLenum FB_TEXTURE_DATATYPE;
void createTexture(const unsigned int winWidth, const unsigned int winHeight);
void deleteTexture();
void checkGL();
bool errorInGL(GLenum& error);
String getGLErrorString(GLenum error);
mutable Mutex contex_mutex_;
bool ignore_events_;
float down_sampling_factor_;
//float stereo_delta_;
};
} // namespace VIEW
} // namespace BALL
#endif // BALL_VIEW_RENDERING_GLRENDERWINDOW_H
|