8 #include "OutputWowDisplay2.hh"
31 " gl_TexCoord[0] = gl_MultiTexCoord0;\r\n"
32 " gl_Position = ftransform();\r\n"
53 string fragmentCode =
"uniform sampler2D tex;"
54 "uniform sampler2D dep;"
55 "varying float disparity;"
59 "vec2 pos = gl_TexCoord[0].st;"
61 "vec3 color = vec3(0.0,0.0,0.0);"
65 "color = texture2D(tex,pos);"
67 "color = vec3(disparity,disparity,disparity);"
70 "gl_FragColor.rgb = color;"
91 unsigned char wow_content = 0x02;
92 unsigned char wow_use_factor = 0x80;
93 unsigned char wow_use_offset = 0x40;
94 unsigned char wow_use_factor_plut_offset = wow_use_factor+wow_use_offset;
95 unsigned char header[] =
96 { 0xF1, wow_content, 50, 0, wow_use_factor_plut_offset, 0x00, 0x00,
100 unsigned long _register = 0;
101 for (
int i = 0; i < 10; ++i)
103 unsigned char mask = 0x80;
104 unsigned char byte = header[i];
105 for (
int j = 0; j < 8; ++j)
107 bool topBit = (_register & 0x80000000) != 0;
109 _register ^= ((byte & mask) != 0 ? 0x1 : 0x0);
112 _register ^= 0x04c11db7;
117 unsigned char *p = (
unsigned char*) &_register;
118 for (
size_t i = 0; i < 4; ++i)
120 header[i + 6] = p[3 - i];
126 for (
int x = 0; x < 256; ++x)
130 for (
int x = 0; x <= 9; ++x)
132 for (
int y = 7; y >= 0; --y)
134 int i = 2 * (7 - y) + 16 * x;
135 fullheader[i] = (((1 << (y)) & (header[x])) << (7 - (y)));
void SetUniform(const std::string &varName, float value)
int InitShader(std::string vertexCode, std::string fragmentCode)
can be called to create output attachment without having to derive new subclass will also create FBO ...
Exception class used for run-time errors in the OpenGLFramework.
const std::string & GetMessageString() const
Returns the description of the error including the file name and line number where the error occured...
BIAS::glfShaderProgram shaderProg_
virtual ~OutputWowDisplay2()
int StandardDraw_()
this function suffices for simple shaders that only need the standard uniforms to be set...
Class for extra rendering pass in GLProjection (for now only used in glutGLviewer) ...
Interface for render targets.