You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(48) |
Sep
(181) |
Oct
(147) |
Nov
(12) |
Dec
(17) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(2) |
Feb
(4) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
(80) |
Sep
(7) |
Oct
|
Nov
|
Dec
(4) |
2007 |
Jan
(5) |
Feb
(4) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Johan S. <jo...@us...> - 2005-08-24 14:25:32
|
Update of /cvsroot/shallows/shallows/include/shallows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13217/include/shallows Modified Files: RenderTexture2D.hpp Log Message: Formatting change Index: RenderTexture2D.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/RenderTexture2D.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RenderTexture2D.hpp 24 Aug 2005 12:03:40 -0000 1.5 --- RenderTexture2D.hpp 24 Aug 2005 14:25:24 -0000 1.6 *************** *** 37,41 **** namespace shallows { ! class RenderTexture2D : public OffScreenRenderTarget { --- 37,41 ---- namespace shallows { ! class RenderTexture2D : public OffScreenRenderTarget { |
From: Johan S. <jo...@us...> - 2005-08-24 14:24:52
|
Update of /cvsroot/shallows/shallows/examples/simpleWave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13020/examples/simpleWave Modified Files: simpleWave.cpp waverenderer.glshader Log Message: Finished simpleWave Index: simpleWave.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/examples/simpleWave/simpleWave.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simpleWave.cpp 24 Aug 2005 12:30:49 -0000 1.1 --- simpleWave.cpp 24 Aug 2005 14:24:40 -0000 1.2 *************** *** 31,34 **** --- 31,35 ---- #include <algorithm> #include <iterator> + #include <vector> #include "shallows/shallows.hpp" #include "shallows/utils/imageCreation.hpp" *************** *** 70,74 **** unsigned int BUF_DIM = 256; ! GLfloat light_position[] = { 1.0/4.0, 0.5, -2.0, 0.0 }; int window_width = 0; --- 71,75 ---- unsigned int BUF_DIM = 256; ! GLfloat light_position[] = { 1.0/4.0, 0.5, 2.0, 0.0 }; int window_width = 0; *************** *** 99,102 **** --- 100,112 ---- renderable.reset( new GPGPURenderable ); + shared_ptr<utils::Image<char> > I = utils::getCharImage( "../../test/images/lena-color-512x512.tiff", 4 ); + background = I->createTexture<Texture2D>( GL_RGBA8 ); + + background->bind(); + /* glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); */ + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + /* Create the shader. * Point it to an inputfile *************** *** 109,116 **** waveshader->setRenderable( renderable ); waveshader->setFrameBuffer( fb ); - - shared_ptr<utils::Image<char> > I = utils::getCharImage( "../../test/images/lena-color-512x512.tiff" ); - - background = I->createTexture<Texture2D>( GL_RGBA ); shared_ptr<OnScreenBuffer> ons_fb(new OnScreenBuffer); --- 119,122 ---- *************** *** 133,178 **** next = rt[2]; - /* glLightfv( GL_LIGHT0, GL_POSITION, light_position ); glEnable( GL_LIGHTING ); glEnable( GL_LIGHT0 ); ! */ ! float pixels[]={0.0, 0.0, 0.0, 0.0, ! 1.0, 0.0, 0.0, 0.0, ! 1.0, 0.0, 0.0, 0.0, ! 1.0, 0.0, 0.0, 0.0, ! ! 1.0, 0.0, 0.0, 0.0, ! 0.0, 0.0, 0.0, 0.0, ! 1.0, 0.0, 0.0, 0.0, ! 1.0, 0.0, 0.0, 0.0, ! ! 1.0, 0.0, 0.0, 0.0, ! 1.0, 0.0, 0.0, 0.0, ! 0.0, 0.0, 0.0, 0.0, ! 1.0, 0.0, 0.0, 0.0, ! ! 1.0, 0.0, 0.0, 0.0, ! 1.0, 0.0, 0.0, 0.0, ! 1.0, 0.0, 0.0, 0.0, ! 0.0, 0.0, 0.0, 0.0}; ! shared_ptr<Texture2D> init_tex = utils::createFloatTexture2D(4, 4, 4, pixels); initProg.reset( new GLProgram ); initProg->readFile("showtex2D.shader"); initProg->setRenderable(renderable); ! /* initProg->setFrameBuffer(fb); initProg->setInputTexture("texture", init_tex); reshape(BUF_DIM, BUF_DIM); - initProg->setOutputTarget(0, prev); initProg->run(); initProg->setOutputTarget(0, curr); initProg->run(); - */ - initProg->setFrameBuffer( ons_fb ); - initProg->setOutputTarget(0, ons_rt); - initProg->setInputTexture( "texture", background ); } --- 139,169 ---- next = rt[2]; glLightfv( GL_LIGHT0, GL_POSITION, light_position ); glEnable( GL_LIGHTING ); glEnable( GL_LIGHT0 ); ! ! float pixels[BUF_DIM][BUF_DIM][4]; ! ! const float h = 1.0/BUF_DIM; ! ! for ( int i = 0; i < BUF_DIM; ++i ) ! for ( int j = 0; j < BUF_DIM; ++j ) ! for ( int k = 0; k < 4; ++k ) ! pixels[i][j][k] = sin( 10*M_PI*h*i) * cos( 5*M_PI*h*j ) + drand48()/1000.0; ! ! shared_ptr<Texture2D> init_tex = utils::createFloatTexture2D( ! BUF_DIM, BUF_DIM, 4, reinterpret_cast<float*>( pixels ) ); initProg.reset( new GLProgram ); initProg->readFile("showtex2D.shader"); initProg->setRenderable(renderable); ! initProg->setFrameBuffer(fb); initProg->setInputTexture("texture", init_tex); reshape(BUF_DIM, BUF_DIM); initProg->setOutputTarget(0, prev); initProg->run(); initProg->setOutputTarget(0, curr); initProg->run(); } *************** *** 182,186 **** try { - /* reshape( BUF_DIM, BUF_DIM ); waveshader->setInputTexture( "texCurrent", curr->getTexture() ); --- 173,176 ---- *************** *** 189,199 **** waveshader->run(); - - */ reshape( window_width, window_height ); ! initProg->run(); ! /* rendershader->setInputTexture( "waveMap", next->getTexture() ); rendershader->run(); - */ prev = curr; --- 179,185 ---- waveshader->run(); reshape( window_width, window_height ); ! rendershader->setInputTexture( "waveMap", next->getTexture() ); rendershader->run(); prev = curr; Index: waverenderer.glshader =================================================================== RCS file: /cvsroot/shallows/shallows/examples/simpleWave/waverenderer.glshader,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** waverenderer.glshader 24 Aug 2005 12:30:49 -0000 1.1 --- waverenderer.glshader 24 Aug 2005 14:24:40 -0000 1.2 *************** *** 46,50 **** bottomCoord = vec2(texXcoord.x + normal.x/10.0, texXcoord.y + normal.y/10.0); ! vec4 backgroundTex = texture2D(backgroundMap, bottomCoord); float diffuse = clamp(dot(lVec, normal), 0.0, 1.0); --- 46,50 ---- bottomCoord = vec2(texXcoord.x + normal.x/10.0, texXcoord.y + normal.y/10.0); ! vec4 backgroundTex = texture2D(backgroundMap, bottomCoord.yx); float diffuse = clamp(dot(lVec, normal), 0.0, 1.0); |
From: Johan S. <jo...@us...> - 2005-08-24 12:31:01
|
Update of /cvsroot/shallows/shallows/examples/simpleWave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20345/examples/simpleWave Added Files: waveequation.glshader simpleWave.cpp waverenderer.glshader showtex2D.shader SConstruct Log Message: Initial revision of simpleWave (does not work correctly). --- NEW FILE: SConstruct --- # $Id: SConstruct,v 1.1 2005/08/24 12:30:49 josse77 Exp $ # This is the SConstruct file for the shallows-test suite # This must be called through the parent SConstruct file. #env = Environment( CPPPATH = ['#include/' ], LIBPATH = [ '#' ]) Import('env') conf = Configure( env.Copy() ) conf.env.Append( LIBPATH = [ '#' ] ) reqclibs = [ 'dl', 'glut' ] reqcxxlibs = [ 'shallows' , 'cppunit'] for lib in reqclibs: if not conf.CheckLib( lib ): print 'Did not find ' + lib + ' library. Aborting.' Exit( 1 ) for lib in reqcxxlibs: if not conf.CheckLib( lib, language='c++' ): print 'Did not find ' + lib + ' library. Aborting.' Exit( 1 ) import glob if conf.env['PLATFORM'] == 'posix': conf.env.Append( LINKFLAGS = '-pthread -Wl,--rpath=../../') env = conf.Finish() # All cpp files in this diretory will be built files = glob.glob('*.cpp') env.Program('simpleWave', files) --- NEW FILE: simpleWave.cpp --- /********************************************************************** * * File: simpleWave.cpp * * Created: Jul 11, 2005 * * Version: $Id: simpleWave.cpp,v 1.1 2005/08/24 12:30:49 josse77 Exp $ * * Authors: Trond R. Hagen <tr...@si...>, * Jon Mikkelsen Hjelmervik <ja...@si...>, * Johan S. Seland <jo...@if...> * * This file is part of the Shallows library. * Copyright (C) 2005 by SINTEF. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. * See the file LICENSE.GPL at the root directory of this source * distribution for additional information about the GNU GPL. * * For using Shallows with software that can not be combined with the * GNU GPL, please contact SINTEF for aquiring a commercial license * and support. * * SINTEF, Pb 124 Blindern, N-0314 Oslo, Norway * http://www.sintef.no *********************************************************************/ #include <iostream> #include <algorithm> #include <iterator> #include "shallows/shallows.hpp" #include "shallows/utils/imageCreation.hpp" #include "shallows/utils/textureCreation.hpp" #include "boost/shared_ptr.hpp" #include <GL/glut.h> using namespace shallows; using namespace std; using boost::shared_ptr; /* The numerical simulation happens in the wave shader. */ shared_ptr<GLProgram> waveshader; /* For visualization we use the rendershader. */ shared_ptr<GLProgram> rendershader; /* For visualization we use the rendershader. */ shared_ptr<GLProgram> initProg; /* The heat equation uses the two last timesteps, hence we need a total * of three rendertextures. */ shared_ptr<RenderTexture2D> rt[3]; shared_ptr<RenderTexture2D> prev, curr, next; /* We need a nice background for rendering. */ shared_ptr<Texture2D> background; /* */ /* Every shader needs to be connected to a renderable to run. * GPGPURenderable draws a basic screen aligned quad. */ shared_ptr<GPGPURenderable> renderable; /* The number of grid points in each direction. */ unsigned int BUF_DIM = 256; GLfloat light_position[] = { 1.0/4.0, 0.5, -2.0, 0.0 }; int window_width = 0; int window_height = 0; void keyboard(unsigned char key, int winx, int winy) { switch(key) { case 'q': exit( EXIT_SUCCESS ); } } void reshape( const int width, const int height ) { glMatrixMode( GL_PROJECTION ); glLoadIdentity(); gluOrtho2D( 0.0, 1.0, 0.0, 1.0 ); glViewport( 0, 0, width, height ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); } void initOpenGL() { renderable.reset( new GPGPURenderable ); /* Create the shader. * Point it to an inputfile * and finally, tell it how to run. */ shared_ptr<OffScreenBuffer> fb(new OffScreenBuffer(BUF_DIM, BUF_DIM)); waveshader.reset( new GLProgram ); waveshader->readFile( "waveequation.glshader" ); waveshader->setRenderable( renderable ); waveshader->setFrameBuffer( fb ); shared_ptr<utils::Image<char> > I = utils::getCharImage( "../../test/images/lena-color-512x512.tiff" ); background = I->createTexture<Texture2D>( GL_RGBA ); shared_ptr<OnScreenBuffer> ons_fb(new OnScreenBuffer); shared_ptr<OnScreenRenderTarget> ons_rt (new OnScreenRenderTarget(GL_BACK_LEFT)); rendershader.reset( new GLProgram); rendershader->readFile( "waverenderer.glshader" ); rendershader->setRenderable( renderable ); rendershader->setFrameBuffer(ons_fb); rendershader->setOutputTarget(0, ons_rt); rendershader->setParam2f("dXY", 1.0/BUF_DIM, 1.0/BUF_DIM ); rendershader->setInputTexture( "backgroundMap", background ); for ( unsigned int i = 0; i < 3; ++i ) rt[i] = fb->createRenderTexture2D(); prev = rt[0]; curr = rt[1]; next = rt[2]; /* glLightfv( GL_LIGHT0, GL_POSITION, light_position ); glEnable( GL_LIGHTING ); glEnable( GL_LIGHT0 ); */ float pixels[]={0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; shared_ptr<Texture2D> init_tex = utils::createFloatTexture2D(4, 4, 4, pixels); initProg.reset( new GLProgram ); initProg->readFile("showtex2D.shader"); initProg->setRenderable(renderable); /* initProg->setFrameBuffer(fb); initProg->setInputTexture("texture", init_tex); reshape(BUF_DIM, BUF_DIM); initProg->setOutputTarget(0, prev); initProg->run(); initProg->setOutputTarget(0, curr); initProg->run(); */ initProg->setFrameBuffer( ons_fb ); initProg->setOutputTarget(0, ons_rt); initProg->setInputTexture( "texture", background ); } void display() { try { /* reshape( BUF_DIM, BUF_DIM ); waveshader->setInputTexture( "texCurrent", curr->getTexture() ); waveshader->setInputTexture( "texLast", prev->getTexture() ); waveshader->setOutputTarget( 0, next ); waveshader->run(); */ reshape( window_width, window_height ); initProg->run(); /* rendershader->setInputTexture( "waveMap", next->getTexture() ); rendershader->run(); */ prev = curr; curr = next; next = prev; } catch (std::exception &e) { std::cout << e.what() << std::endl; exit( EXIT_FAILURE ); } glutSwapBuffers(); glutPostRedisplay(); } void reshape_callback( const int width, const int height ) { window_width = width; window_height = height; reshape(window_width, window_height); } int main( int argc, char *argv[] ) { glutInit(&argc, argv); glutInitWindowPosition(100, 100); glutInitWindowSize(512, 512); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); int windowID = glutCreateWindow("Simple Wave Equation"); glutSetWindow(windowID); glutReshapeFunc(reshape_callback); glutKeyboardFunc(keyboard); glutDisplayFunc(display); reshape_callback( 512, 512 ); try { initOpenGL(); } catch (shallows::compile_error &e) { std::cout << "Compile error:\n " << e.log() << std::endl; exit( EXIT_FAILURE ); } catch (std::exception &e) { std::cout << e.what() << std::endl; exit( EXIT_FAILURE ); } glutMainLoop(); exit( EXIT_SUCCESS ); } --- NEW FILE: waverenderer.glshader --- //================================================================================== // // File: WaveRenderer.shader // // Created: April 2004 // // Author: Trond R. Hagen <tr...@si...> // // Description: // //================================================================================== [Fragment shader] varying vec4 texXcoord; varying vec4 texYcoord; varying vec3 lightVec; varying vec3 viewVec; varying vec3 norm; uniform sampler2D waveMap; uniform sampler2D backgroundMap; void main(void) { //vec4 waveTex = texture2D(waveMap, texXcoord.yx); vec4 tex0 = texture2D(waveMap, texXcoord.wx); // Ux+1 vec4 tex1 = texture2D(waveMap, texXcoord.zx); // Ux-1 vec4 tex2 = texture2D(waveMap, texYcoord.xw); // Uy+1 vec4 tex3 = texture2D(waveMap, texYcoord.xz); // Uy-1 vec2 val; vec2 bottomCoord; val.x = (tex1.x-tex0.x)*5.0; val.y = (tex3.x-tex2.x)*5.0; vec3 normal = norm + val.x*vec3(1.0, 0.0, 0.0) + val.y*vec3(0.0, 1.0, 0.0); normal = normalize(normal); vec3 lVec = normalize(lightVec); vec3 vVec = normalize(viewVec); bottomCoord = vec2(texXcoord.x + normal.x/10.0, texXcoord.y + normal.y/10.0); vec4 backgroundTex = texture2D(backgroundMap, bottomCoord); float diffuse = clamp(dot(lVec, normal), 0.0, 1.0); float specular = pow(clamp(dot(reflect(-vVec, normal), lVec), 0.0, 1.0), 32.0); gl_FragColor = (diffuse + 0.2) * backgroundTex + (0.6 * specular); // gl_FragColor.rgb = vec3(0.5)+2.0*tex0.xyz; } [Vertex shader] varying vec4 texXcoord; varying vec4 texYcoord; varying vec3 lightVec; varying vec3 viewVec; varying vec3 norm; uniform vec2 dXY; void main(void) { vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex; lightVec = normalize(gl_LightSource[0].position.xyz - vec3(ecPosition)); viewVec = normalize(vec3 (-ecPosition)); norm = normalize(gl_NormalMatrix * gl_Normal); texXcoord=gl_MultiTexCoord0.yxxx+vec4(0.0,0.0,-1.0,1.0)*dXY.x; texYcoord=gl_MultiTexCoord0.xyyy+vec4(0.0,0.0,-1.0,1.0)*dXY.y; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } --- NEW FILE: showtex2D.shader --- // -*-C++-*- [Vertex shader] void main () { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; gl_TexCoord[0]=gl_MultiTexCoord0; } [Fragment shader] uniform sampler2D texture; void main () { vec4 col=texture2D(texture, gl_TexCoord[0].xy); gl_FragColor = col; } --- NEW FILE: waveequation.glshader --- //================================================================================== // // File: WaveEquation.shader // // Created: March 2004 // // Author: Trond R. Hagen <tr...@si...> // // Description: // //================================================================================== [Fragment shader] varying vec4 texXcoord; varying vec4 texYcoord; uniform sampler2D texCurrent; uniform sampler2D texLast; void main(void) { vec4 col; vec4 tex = texture2D(texCurrent, texXcoord.yx); vec4 tex0 = texture2D(texCurrent, texXcoord.wx); vec4 tex1 = texture2D(texCurrent, texXcoord.zx); vec4 tex2 = texture2D(texCurrent, texYcoord.xw); vec4 tex3 = texture2D(texCurrent, texYcoord.xz); vec4 texL = texture2D(texLast, texXcoord.yx); gl_FragColor = (2.0 * tex - texL + (2.0/4.0)*(tex0 + tex1 + tex2 + tex3 - 4.0*tex))*0.997; } [Vertex shader] varying vec4 texXcoord; varying vec4 texYcoord; uniform vec2 dXY; void main(void) { texXcoord=gl_MultiTexCoord0.yxxx+vec4(0.0,0.0,-1.0,1.0)*dXY.x; texYcoord=gl_MultiTexCoord0.xyyy+vec4(0.0,0.0,-1.0,1.0)*dXY.y; //gl_Position = ftransform(); gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } |
From: Johan S. <jo...@us...> - 2005-08-24 12:29:06
|
Update of /cvsroot/shallows/shallows/examples/simpleWave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19859/examples/simpleWave Log Message: Directory /cvsroot/shallows/shallows/examples/simpleWave added to the repository |
From: Trond H. <tr...@us...> - 2005-08-24 12:09:51
|
Update of /cvsroot/shallows/shallows/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15028/src Modified Files: ShallowsExt.cpp Log Message: Added OpenGL 2.0 support Index: ShallowsExt.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/ShallowsExt.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ShallowsExt.cpp 24 Aug 2005 10:36:43 -0000 1.5 --- ShallowsExt.cpp 24 Aug 2005 12:09:31 -0000 1.6 *************** *** 65,69 **** /*****************************************************************************/ ! if(!internal::isShaderExtensionSupported("GL_VERSION_2_0")) return false; if(!internal::isShaderExtensionSupported("GL_ARB_shader_objects")) return false; if(!internal::isShaderExtensionSupported("GL_ARB_fragment_shader")) return false; --- 65,69 ---- /*****************************************************************************/ ! // if(!internal::isShaderExtensionSupported("GL_VERSION_2_0")) return false; if(!internal::isShaderExtensionSupported("GL_ARB_shader_objects")) return false; if(!internal::isShaderExtensionSupported("GL_ARB_fragment_shader")) return false; *************** *** 104,107 **** --- 104,393 ---- } + #ifdef GL_VERSION_2_0 + else if(0 == strcmp(extension, "GL_VERSION_2_0")) + { + glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)wglGetProcAddress("glBlendEquationSeparate"); + if(NULL == glBlendEquationSeparate) return false; + + glDrawBuffers = (PFNGLDRAWBUFFERSPROC)wglGetProcAddress("glDrawBuffers"); + if(NULL == glDrawBuffers) return false; + + glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)wglGetProcAddress("glStencilOpSeparate"); + if(NULL == glStencilOpSeparate) return false; + + glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)wglGetProcAddress("glStencilFuncSeparate"); + if(NULL == glStencilFuncSeparate) return false; + + glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)wglGetProcAddress("glStencilMaskSeparate"); + if(NULL == glStencilMaskSeparate) return false; + + glAttachShader = (PFNGLATTACHSHADERPROC)wglGetProcAddress("glAttachShader"); + if(NULL == glAttachShader) return false; + + glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)wglGetProcAddress("glBindAttribLocation"); + if(NULL == glBindAttribLocation) return false; + + glCompileShader = (PFNGLCOMPILESHADERPROC)wglGetProcAddress("glCompileShader"); + if(NULL == glCompileShader) return false; + + glCreateProgram = (PFNGLCREATEPROGRAMPROC)wglGetProcAddress("glCreateProgram"); + if(NULL == glCreateProgram) return false; + + glCreateShader = (PFNGLCREATESHADERPROC)wglGetProcAddress("glCreateShader"); + if(NULL == glCreateShader) return false; + + glDeleteProgram = (PFNGLDELETEPROGRAMPROC)wglGetProcAddress("glDeleteProgram"); + if(NULL == glDeleteProgram) return false; + + glDeleteShader = (PFNGLDELETESHADERPROC)wglGetProcAddress("glDeleteShader"); + if(NULL == glDeleteShader) return false; + + glDetachShader = (PFNGLDETACHSHADERPROC)wglGetProcAddress("glDetachShader"); + if(NULL == glDetachShader) return false; + + glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)wglGetProcAddress("glDisableVertexAttribArray"); + if(NULL == glDisableVertexAttribArray) return false; + + glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)wglGetProcAddress("glEnableVertexAttribArray"); + if(NULL == glEnableVertexAttribArray) return false; + + glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)wglGetProcAddress("glGetActiveAttrib"); + if(NULL == glGetActiveAttrib) return false; + + glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)wglGetProcAddress("glGetActiveUniform"); + if(NULL == glGetActiveUniform) return false; + + glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)wglGetProcAddress("glGetAttachedShaders"); + if(NULL == glGetAttachedShaders) return false; + + glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)wglGetProcAddress("glGetAttribLocation"); + if(NULL == glGetAttribLocation) return false; + + glGetProgramiv = (PFNGLGETPROGRAMIVPROC)wglGetProcAddress("glGetProgramiv"); + if(NULL == glGetProgramiv) return false; + + glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)wglGetProcAddress("glGetProgramInfoLog"); + if(NULL == glGetProgramInfoLog) return false; + + glGetShaderiv = (PFNGLGETSHADERIVPROC)wglGetProcAddress("glGetShaderiv"); + if(NULL == glGetShaderiv) return false; + + glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)wglGetProcAddress("glGetShaderInfoLog"); + if(NULL == glGetShaderInfoLog) return false; + + glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)wglGetProcAddress("glGetShaderSource"); + if(NULL == glGetShaderSource) return false; + + glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)wglGetProcAddress("glGetUniformLocation"); + if(NULL == glGetUniformLocation) return false; + + glGetUniformfv = (PFNGLGETUNIFORMFVPROC)wglGetProcAddress("glGetUniformfv"); + if(NULL == glGetUniformfv) return false; + + glGetUniformiv = (PFNGLGETUNIFORMIVPROC)wglGetProcAddress("glGetUniformiv"); + if(NULL == glGetUniformiv) return false; + + glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)wglGetProcAddress("glGetVertexAttribdv"); + if(NULL == glGetVertexAttribdv) return false; + + glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)wglGetProcAddress("glGetVertexAttribfv"); + if(NULL == glGetVertexAttribfv) return false; + + glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)wglGetProcAddress("glGetVertexAttribiv"); + if(NULL == glGetVertexAttribiv) return false; + + glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)wglGetProcAddress("glGetVertexAttribPointerv"); + if(NULL == glGetVertexAttribPointerv) return false; + + glIsProgram = (PFNGLISPROGRAMPROC)wglGetProcAddress("glIsProgram"); + if(NULL == glIsProgram) return false; + + glIsShader = (PFNGLISSHADERPROC)wglGetProcAddress("glIsShader"); + if(NULL == glIsShader) return false; + + glLinkProgram = (PFNGLLINKPROGRAMPROC)wglGetProcAddress("glLinkProgram"); + if(NULL == glLinkProgram) return false; + + glShaderSource = (PFNGLSHADERSOURCEPROC)wglGetProcAddress("glShaderSource"); + if(NULL == glShaderSource) return false; + + glUseProgram = (PFNGLUSEPROGRAMPROC)wglGetProcAddress("glUseProgram"); + if(NULL == glUseProgram) return false; + + glUniform1f = (PFNGLUNIFORM1FPROC)wglGetProcAddress("glUniform1f"); + if(NULL == glUniform1f) return false; + + glUniform2f = (PFNGLUNIFORM2FPROC)wglGetProcAddress("glUniform2f"); + if(NULL == glUniform2f) return false; + + glUniform3f = (PFNGLUNIFORM3FPROC)wglGetProcAddress("glUniform3f"); + if(NULL == glUniform3f) return false; + + glUniform4f = (PFNGLUNIFORM4FPROC)wglGetProcAddress("glUniform4f"); + if(NULL == glUniform4f) return false; + + glUniform1i = (PFNGLUNIFORM1IPROC)wglGetProcAddress("glUniform1i"); + if(NULL == glUniform1i) return false; + + glUniform2i = (PFNGLUNIFORM2IPROC)wglGetProcAddress("glUniform2i"); + if(NULL == glUniform2i) return false; + + glUniform3i = (PFNGLUNIFORM3IPROC)wglGetProcAddress("glUniform3i"); + if(NULL == glUniform3i) return false; + + glUniform4i = (PFNGLUNIFORM4IPROC)wglGetProcAddress("glUniform4i"); + if(NULL == glUniform4i) return false; + + glUniform1fv = (PFNGLUNIFORM1FVPROC)wglGetProcAddress("glUniform1fv"); + if(NULL == glUniform1fv) return false; + + glUniform2fv = (PFNGLUNIFORM2FVPROC)wglGetProcAddress("glUniform2fv"); + if(NULL == glUniform2fv) return false; + + glUniform3fv = (PFNGLUNIFORM3FVPROC)wglGetProcAddress("glUniform3fv"); + if(NULL == glUniform3fv) return false; + + glUniform4fv = (PFNGLUNIFORM4FVPROC)wglGetProcAddress("glUniform4fv"); + if(NULL == glUniform4fv) return false; + + glUniform1iv = (PFNGLUNIFORM1IVPROC)wglGetProcAddress("glUniform1iv"); + if(NULL == glUniform1iv) return false; + + glUniform2iv = (PFNGLUNIFORM2IVPROC)wglGetProcAddress("glUniform2iv"); + if(NULL == glUniform2iv) return false; + + glUniform3iv = (PFNGLUNIFORM3IVPROC)wglGetProcAddress("glUniform3iv"); + if(NULL == glUniform3iv) return false; + + glUniform4iv = (PFNGLUNIFORM4IVPROC)wglGetProcAddress("glUniform4iv"); + if(NULL == glUniform4iv) return false; + + glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)wglGetProcAddress("glUniformMatrix2fv"); + if(NULL == glUniformMatrix2fv) return false; + + glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)wglGetProcAddress("glUniformMatrix3fv"); + if(NULL == glUniformMatrix3fv) return false; + + glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)wglGetProcAddress("glUniformMatrix4fv"); + if(NULL == glUniformMatrix4fv) return false; + + glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)wglGetProcAddress("glValidateProgram"); + if(NULL == glValidateProgram) return false; + + glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)wglGetProcAddress("glVertexAttrib1d"); + if(NULL == glVertexAttrib1d) return false; + + glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)wglGetProcAddress("glVertexAttrib1dv"); + if(NULL == glVertexAttrib1dv) return false; + + glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)wglGetProcAddress("glVertexAttrib1f"); + if(NULL == glVertexAttrib1f) return false; + + glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)wglGetProcAddress("glVertexAttrib1fv"); + if(NULL == glVertexAttrib1fv) return false; + + glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)wglGetProcAddress("glVertexAttrib1s"); + if(NULL == glVertexAttrib1s) return false; + + glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)wglGetProcAddress("glVertexAttrib1sv"); + if(NULL == glVertexAttrib1sv) return false; + + glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)wglGetProcAddress("glVertexAttrib2d"); + if(NULL == glVertexAttrib2d) return false; + + glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)wglGetProcAddress("glVertexAttrib2dv"); + if(NULL == glVertexAttrib2dv) return false; + + glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)wglGetProcAddress("glVertexAttrib2f"); + if(NULL == glVertexAttrib2f) return false; + + glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)wglGetProcAddress("glVertexAttrib2fv"); + if(NULL == glVertexAttrib2fv) return false; + + glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)wglGetProcAddress("glVertexAttrib2s"); + if(NULL == glVertexAttrib2s) return false; + + glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)wglGetProcAddress("glVertexAttrib2sv"); + if(NULL == glVertexAttrib2sv) return false; + + glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)wglGetProcAddress("glVertexAttrib3d"); + if(NULL == glVertexAttrib3d) return false; + + glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)wglGetProcAddress("glVertexAttrib3dv"); + if(NULL == glVertexAttrib3dv) return false; + + glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)wglGetProcAddress("glVertexAttrib3f"); + if(NULL == glVertexAttrib3f) return false; + + glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)wglGetProcAddress("glVertexAttrib3fv"); + if(NULL == glVertexAttrib3fv) return false; + + glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)wglGetProcAddress("glVertexAttrib3s"); + if(NULL == glVertexAttrib3s) return false; + + glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)wglGetProcAddress("glVertexAttrib3sv"); + if(NULL == glVertexAttrib3sv) return false; + + glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)wglGetProcAddress("glVertexAttrib4Nbv"); + if(NULL == glVertexAttrib4Nbv) return false; + + glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)wglGetProcAddress("glVertexAttrib4Niv"); + if(NULL == glVertexAttrib4Niv) return false; + + glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)wglGetProcAddress("glVertexAttrib4Nsv"); + if(NULL == glVertexAttrib4Nsv) return false; + + glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)wglGetProcAddress("glVertexAttrib4Nub"); + if(NULL == glVertexAttrib4Nub) return false; + + glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)wglGetProcAddress("glVertexAttrib4Nubv"); + if(NULL == glVertexAttrib4Nubv) return false; + + glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)wglGetProcAddress("glVertexAttrib4Nuiv"); + if(NULL == glVertexAttrib4Nuiv) return false; + + glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)wglGetProcAddress("glVertexAttrib4Nusv"); + if(NULL == glVertexAttrib4Nusv) return false; + + glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)wglGetProcAddress("glVertexAttrib4bv"); + if(NULL == glVertexAttrib4bv) return false; + + glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)wglGetProcAddress("glVertexAttrib4d"); + if(NULL == glVertexAttrib4d) return false; + + glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)wglGetProcAddress("glVertexAttrib4dv"); + if(NULL == glVertexAttrib4dv) return false; + + glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)wglGetProcAddress("glVertexAttrib4f"); + if(NULL == glVertexAttrib4f) return false; + + glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)wglGetProcAddress("glVertexAttrib4fv"); + if(NULL == glVertexAttrib4fv) return false; + + glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)wglGetProcAddress("glVertexAttrib4iv"); + if(NULL == glVertexAttrib4iv) return false; + + glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)wglGetProcAddress("glVertexAttrib4s"); + if(NULL == glVertexAttrib4s) return false; + + glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)wglGetProcAddress("glVertexAttrib4sv"); + if(NULL == glVertexAttrib4sv) return false; + + glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)wglGetProcAddress("glVertexAttrib4ubv"); + if(NULL == glVertexAttrib4ubv) return false; + + glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)wglGetProcAddress("glVertexAttrib4uiv"); + if(NULL == glVertexAttrib4uiv) return false; + + glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)wglGetProcAddress("glVertexAttrib4usv"); + if(NULL == glVertexAttrib4usv) return false; + + glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)wglGetProcAddress("glVertexAttribPointer"); + if(NULL == glVertexAttribPointer) return false; + } + #endif + + + #ifdef GL_ARB_vertex_shader else if(0 == strcmp(extension, "GL_ARB_vertex_shader")) |
Update of /cvsroot/shallows/shallows/include/shallows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13393/include/shallows Modified Files: FrameBuffer.hpp OffScreenBuffer.hpp OffScreenRenderTarget.hpp OnScreenBuffer.hpp OnScreenRenderTarget.hpp RenderTarget.hpp RenderTexture2D.hpp Log Message: RenderTargets now remembers which color buffer it was attached to previously, and can be reattached to it Index: OnScreenRenderTarget.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/OnScreenRenderTarget.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OnScreenRenderTarget.hpp 18 Jul 2005 13:40:49 -0000 1.1 --- OnScreenRenderTarget.hpp 24 Aug 2005 12:03:40 -0000 1.2 *************** *** 43,47 **** virtual ~OnScreenRenderTarget(); ! virtual void bindToCurrentFrameBuffer(unsigned int colBufId=0); private: --- 43,47 ---- virtual ~OnScreenRenderTarget(); ! virtual void bindToCurrentFrameBuffer(int colBufId); private: Index: OnScreenBuffer.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/OnScreenBuffer.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OnScreenBuffer.hpp 18 Jul 2005 13:40:49 -0000 1.1 --- OnScreenBuffer.hpp 24 Aug 2005 12:03:40 -0000 1.2 *************** *** 43,47 **** OnScreenBuffer(); virtual ~OnScreenBuffer(); ! virtual void attachRenderTarget(RenderTarget &r, unsigned int colBufId) ; virtual void validateRenderTarget(const shallows::RenderTarget &r) ; virtual void activate(); --- 43,47 ---- OnScreenBuffer(); virtual ~OnScreenBuffer(); ! virtual void attachRenderTarget(RenderTarget &r, int colBufId) ; virtual void validateRenderTarget(const shallows::RenderTarget &r) ; virtual void activate(); Index: RenderTexture2D.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/RenderTexture2D.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RenderTexture2D.hpp 18 Jul 2005 13:26:22 -0000 1.4 --- RenderTexture2D.hpp 24 Aug 2005 12:03:40 -0000 1.5 *************** *** 45,49 **** virtual ~RenderTexture2D(); ! virtual void bindToCurrentFrameBuffer(unsigned int colBufId); unsigned int getWidth() const; unsigned int getHeight() const; --- 45,49 ---- virtual ~RenderTexture2D(); ! virtual void bindToCurrentFrameBuffer(int colBufId); unsigned int getWidth() const; unsigned int getHeight() const; Index: FrameBuffer.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/FrameBuffer.hpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FrameBuffer.hpp 14 Jul 2005 11:47:19 -0000 1.9 --- FrameBuffer.hpp 24 Aug 2005 12:03:40 -0000 1.10 *************** *** 41,45 **** FrameBuffer(); virtual ~FrameBuffer(); ! virtual void attachRenderTarget(RenderTarget &r, unsigned int colBufId) = 0; virtual void validateRenderTarget(const shallows::RenderTarget &r) = 0; virtual void activate() = 0; --- 41,45 ---- FrameBuffer(); virtual ~FrameBuffer(); ! virtual void attachRenderTarget(RenderTarget &r, int colBufId=-1) = 0; virtual void validateRenderTarget(const shallows::RenderTarget &r) = 0; virtual void activate() = 0; *************** *** 47,50 **** --- 47,51 ---- virtual unsigned int *drawBuffers(int n) = 0; + protected: private: Index: RenderTarget.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/RenderTarget.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RenderTarget.hpp 19 Jul 2005 13:24:19 -0000 1.4 --- RenderTarget.hpp 24 Aug 2005 12:03:40 -0000 1.5 *************** *** 41,45 **** virtual ~RenderTarget(); ! virtual void bindToCurrentFrameBuffer(unsigned int colBufId) = 0; /* virtual unsigned int getWidth() const = 0; --- 41,46 ---- virtual ~RenderTarget(); ! virtual void bindToCurrentFrameBuffer(int colBufId=-1) = 0; ! /* virtual unsigned int getWidth() const = 0; *************** *** 47,50 **** --- 48,53 ---- virtual int getInternalFormat() const = 0; */ + protected: + mutable int prevColBufId_; private: Index: OffScreenRenderTarget.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/OffScreenRenderTarget.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OffScreenRenderTarget.hpp 18 Jul 2005 13:26:22 -0000 1.1 --- OffScreenRenderTarget.hpp 24 Aug 2005 12:03:40 -0000 1.2 *************** *** 43,47 **** virtual ~OffScreenRenderTarget(); ! virtual void bindToCurrentFrameBuffer(unsigned int colBufId) = 0; virtual unsigned int getWidth() const = 0; virtual unsigned int getHeight() const = 0; --- 43,47 ---- virtual ~OffScreenRenderTarget(); ! // virtual void bindToCurrentFrameBuffer(int colBufId=-1) = 0; virtual unsigned int getWidth() const = 0; virtual unsigned int getHeight() const = 0; Index: OffScreenBuffer.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/OffScreenBuffer.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OffScreenBuffer.hpp 23 Aug 2005 14:33:30 -0000 1.4 --- OffScreenBuffer.hpp 24 Aug 2005 12:03:40 -0000 1.5 *************** *** 52,56 **** virtual boost::shared_ptr<RenderTexture2D> createRenderTextureRectangle(); ! virtual void attachRenderTarget(RenderTarget &r, unsigned int colBufId); virtual void validateRenderTarget(const shallows::RenderTarget &r); virtual void validateRenderTarget(const OffScreenRenderTarget &r); --- 52,56 ---- virtual boost::shared_ptr<RenderTexture2D> createRenderTextureRectangle(); ! virtual void attachRenderTarget(RenderTarget &r, int colBufId); virtual void validateRenderTarget(const shallows::RenderTarget &r); virtual void validateRenderTarget(const OffScreenRenderTarget &r); |
From: Jon H. <jon...@us...> - 2005-08-24 12:03:56
|
Update of /cvsroot/shallows/shallows/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13393/src Modified Files: OffScreenBuffer.cpp OnScreenBuffer.cpp OnScreenRenderTarget.cpp RenderTarget.cpp RenderTexture2D.cpp Log Message: RenderTargets now remembers which color buffer it was attached to previously, and can be reattached to it Index: RenderTexture2D.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/RenderTexture2D.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RenderTexture2D.cpp 23 Aug 2005 14:33:30 -0000 1.5 --- RenderTexture2D.cpp 24 Aug 2005 12:03:40 -0000 1.6 *************** *** 49,54 **** ! void RenderTexture2D::bindToCurrentFrameBuffer(unsigned int colBufId) { if (texture_->isRectangular()) { --- 49,58 ---- ! void RenderTexture2D::bindToCurrentFrameBuffer(int colBufId) { + if (colBufId<0) + colBufId=prevColBufId_; + else + prevColBufId_=colBufId; if (texture_->isRectangular()) { Index: OffScreenBuffer.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/OffScreenBuffer.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OffScreenBuffer.cpp 23 Aug 2005 14:33:30 -0000 1.7 --- OffScreenBuffer.cpp 24 Aug 2005 12:03:40 -0000 1.8 *************** *** 152,156 **** } ! void OffScreenBuffer::attachRenderTarget(RenderTarget &r, unsigned int colBufId) { OffScreenRenderTarget &of_rt = dynamic_cast<OffScreenRenderTarget &> (r); --- 152,156 ---- } ! void OffScreenBuffer::attachRenderTarget(RenderTarget &r, int colBufId) { OffScreenRenderTarget &of_rt = dynamic_cast<OffScreenRenderTarget &> (r); *************** *** 167,170 **** --- 167,171 ---- } + void OffScreenBuffer::validateRenderTarget(const RenderTarget &r) { Index: OnScreenBuffer.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/OnScreenBuffer.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OnScreenBuffer.cpp 19 Jul 2005 13:25:10 -0000 1.2 --- OnScreenBuffer.cpp 24 Aug 2005 12:03:40 -0000 1.3 *************** *** 49,53 **** } ! void OnScreenBuffer::attachRenderTarget(RenderTarget &r, unsigned int colBufId) { validateRenderTarget(r); --- 49,53 ---- } ! void OnScreenBuffer::attachRenderTarget(RenderTarget &r, int colBufId) { validateRenderTarget(r); *************** *** 57,60 **** --- 57,61 ---- } + void OnScreenBuffer::validateRenderTarget(const RenderTarget &r) { Index: RenderTarget.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/RenderTarget.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RenderTarget.cpp 13 Jul 2005 12:18:45 -0000 1.1 --- RenderTarget.cpp 24 Aug 2005 12:03:40 -0000 1.2 *************** *** 33,37 **** namespace shallows { ! RenderTarget::RenderTarget() { } --- 33,37 ---- namespace shallows { ! RenderTarget::RenderTarget() : prevColBufId_(0) { } Index: OnScreenRenderTarget.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/OnScreenRenderTarget.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OnScreenRenderTarget.cpp 19 Jul 2005 10:25:42 -0000 1.2 --- OnScreenRenderTarget.cpp 24 Aug 2005 12:03:40 -0000 1.3 *************** *** 47,51 **** } ! void OnScreenRenderTarget::bindToCurrentFrameBuffer(unsigned int colBufId) { glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); --- 47,51 ---- } ! void OnScreenRenderTarget::bindToCurrentFrameBuffer(int colBufId) { glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); |
From: Johan S. <jo...@us...> - 2005-08-24 11:21:50
|
Update of /cvsroot/shallows/shallows/include/shallows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5732/include/shallows Modified Files: shallows.hpp Log Message: Added #includes for every header file in shallows. Index: shallows.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/shallows.hpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shallows.hpp 24 Aug 2005 10:36:43 -0000 1.6 --- shallows.hpp 24 Aug 2005 11:21:40 -0000 1.7 *************** *** 12,15 **** --- 12,32 ---- */ + #include "shallows/Program.hpp" + #include "shallows/CgProgram.hpp" + #include "shallows/GLProgram.hpp" + #include "shallows/FrameBuffer.hpp" + #include "shallows/GPGPURenderable.hpp" + #include "shallows/OffScreenBuffer.hpp" + #include "shallows/OffScreenRenderTarget.hpp" + #include "shallows/OnScreenBuffer.hpp" + #include "shallows/OnScreenRenderTarget.hpp" + #include "shallows/Renderable.hpp" + #include "shallows/RenderTarget.hpp" + #include "shallows/RenderTexture2D.hpp" + #include "shallows/shallowsexcept.hpp" + #include "shallows/Texture.hpp" + #include "shallows/Texture2D.hpp" + + namespace shallows { |
From: Jon H. <jon...@us...> - 2005-08-24 10:36:56
|
Update of /cvsroot/shallows/shallows/include/shallows/internal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28228/include/shallows/internal Modified Files: ShallowsExt.hpp Log Message: Changed namespace for intitializeShaderExtension, and added init_shallows function Index: ShallowsExt.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/internal/ShallowsExt.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ShallowsExt.hpp 19 Jul 2005 08:32:59 -0000 1.4 --- ShallowsExt.hpp 24 Aug 2005 10:36:43 -0000 1.5 *************** *** 41,46 **** namespace internal // ensure that namespace is defined { - } bool initShaderExtensions(); } --- 41,46 ---- namespace internal // ensure that namespace is defined { bool initShaderExtensions(); + } } *************** *** 54,61 **** namespace shallows { - bool initShaderExtensions(); namespace internal { bool isShaderExtensionSupported(const char *extension); --- 54,61 ---- namespace shallows { namespace internal { + bool initShaderExtensions(); bool isShaderExtensionSupported(const char *extension); |
From: Jon H. <jon...@us...> - 2005-08-24 10:36:56
|
Update of /cvsroot/shallows/shallows/examples/simpleHeat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28228/examples/simpleHeat Modified Files: simpleHeat.cpp Log Message: Changed namespace for intitializeShaderExtension, and added init_shallows function Index: simpleHeat.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/examples/simpleHeat/simpleHeat.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** simpleHeat.cpp 23 Aug 2005 09:03:56 -0000 1.2 --- simpleHeat.cpp 24 Aug 2005 10:36:42 -0000 1.3 *************** *** 12,15 **** --- 12,16 ---- #include "shallows/GPGPURenderable.hpp" #include "shallows/shallowsexcept.hpp" + #include "shallows/shallows.hpp" using boost::shared_ptr; *************** *** 59,62 **** --- 60,64 ---- void initOpengl() { + shallows::init_shallows(); renderable.reset(new GPGPURenderable); float pixels[]={0.0, 0.0, 0.0, 0.0, |
From: Jon H. <jon...@us...> - 2005-08-24 10:36:55
|
Update of /cvsroot/shallows/shallows/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28228/src Modified Files: ShallowsExt.cpp shallows.cpp Log Message: Changed namespace for intitializeShaderExtension, and added init_shallows function Index: ShallowsExt.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/ShallowsExt.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ShallowsExt.cpp 19 Jul 2005 08:32:59 -0000 1.4 --- ShallowsExt.cpp 24 Aug 2005 10:36:43 -0000 1.5 *************** *** 37,40 **** --- 37,42 ---- namespace shallows { + namespace internal + { bool initShaderExtensions() { *************** *** 42,45 **** --- 44,48 ---- } } + } #else #include <windows.h> *************** *** 53,56 **** --- 56,61 ---- namespace shallows { + namespace internal + { bool initShaderExtensions() { *************** *** 89,94 **** ! namespace internal ! { static bool generateShaderExtension(const char* extension) --- 94,99 ---- ! //namespace internal ! //{ static bool generateShaderExtension(const char* extension) Index: shallows.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/shallows.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shallows.cpp 23 Aug 2005 14:30:34 -0000 1.4 --- shallows.cpp 24 Aug 2005 10:36:43 -0000 1.5 *************** *** 1,4 **** --- 1,7 ---- #include "shallows/shallows.hpp" #include "shallows/internal/GLIncludes.hpp" + #include "shallows/internal/ShallowsExt.hpp" + #include "shallows/shallowsexcept.hpp" + #include <iostream> #include <GL/glu.h> *************** *** 11,14 **** --- 14,23 ---- } + void + init_shallows() { + if (internal::initShaderExtensions()==false) + throw missing_extenstions("OpenGL extension missing"); + } + void check_GL( std::string s, int line ) throw ( std::runtime_error ) { |
From: Jon H. <jon...@us...> - 2005-08-24 10:36:54
|
Update of /cvsroot/shallows/shallows/include/shallows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28228/include/shallows Modified Files: shallows.hpp shallowsexcept.hpp Log Message: Changed namespace for intitializeShaderExtension, and added init_shallows function Index: shallowsexcept.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/shallowsexcept.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shallowsexcept.hpp 18 Jul 2005 11:48:49 -0000 1.5 --- shallowsexcept.hpp 24 Aug 2005 10:36:43 -0000 1.6 *************** *** 35,38 **** --- 35,43 ---- namespace shallows { + class missing_extenstions : public std::runtime_error { + public: + missing_extenstions( const std::string& arg ) : runtime_error( arg ) {}; + }; + class not_implemented : public std::runtime_error { public: Index: shallows.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/shallows.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shallows.hpp 19 Jul 2005 13:10:54 -0000 1.5 --- shallows.hpp 24 Aug 2005 10:36:43 -0000 1.6 *************** *** 17,21 **** --- 17,27 ---- void set_fixed_function(); + + /** Initialize the shallows library, including OpenGL extenstions. + important for Windows compatibility. */ + void + init_shallows(); + /** Check if OpenGL has flagged an error, and throw and exception if it has. \param filename The current file |
From: Johan S. <jo...@us...> - 2005-08-24 07:55:25
|
Update of /cvsroot/shallows/shallows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27126 Modified Files: SConstruct Log Message: Fixed builing on windows. Index: SConstruct =================================================================== RCS file: /cvsroot/shallows/shallows/SConstruct,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** SConstruct 23 Aug 2005 14:40:08 -0000 1.21 --- SConstruct 24 Aug 2005 07:55:12 -0000 1.22 *************** *** 7,11 **** unixlibs = [ 'GL', 'GLU', 'boost_regex' ] ! win32libs = ['opengl32', 'glu32', 'boost_regex' ] #optwin32libs = [ 'cg', 'cgGL' ] #optunixlibs = [ 'Magick++', 'png', 'Cg', 'CgGL' ] --- 7,11 ---- unixlibs = [ 'GL', 'GLU', 'boost_regex' ] ! win32libs = ['opengl32', 'glu32' ] #optwin32libs = [ 'cg', 'cgGL' ] #optunixlibs = [ 'Magick++', 'png', 'Cg', 'CgGL' ] *************** *** 113,116 **** --- 113,120 ---- opt = optwin32 reqclibs = win32libs + + # OpenGL-headers require windows.h to be included. + for i in range(len(reqcheaders)): + reqcheaders[i] = ['windows.h', reqcheaders[i]] elif env['PLATFORM'] == 'cygwin': # Should Cygwin default to UNIX? *************** *** 183,186 **** --- 187,193 ---- SConscript('examples/simpleMRT/SConstruct', exports='env') + if 'examples/simpleWave' in COMMAND_LINE_TARGETS: + SConscript('examples/simpleWave/SConstruct', exports='env') + if 'doc' in COMMAND_LINE_TARGETS: doxygen = findexecutable( 'doxygen' ) |
From: Jon H. <jon...@us...> - 2005-08-23 14:40:16
|
Update of /cvsroot/shallows/shallows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17145 Modified Files: SConstruct Log Message: Added simple Multiple Render Targets example using rectangular textures Index: SConstruct =================================================================== RCS file: /cvsroot/shallows/shallows/SConstruct,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** SConstruct 19 Jul 2005 11:34:33 -0000 1.20 --- SConstruct 23 Aug 2005 14:40:08 -0000 1.21 *************** *** 179,182 **** --- 179,185 ---- if 'examples/simpleHeat' in COMMAND_LINE_TARGETS: SConscript('examples/simpleHeat/SConstruct', exports='env') + + if 'examples/simpleMRT' in COMMAND_LINE_TARGETS: + SConscript('examples/simpleMRT/SConstruct', exports='env') if 'doc' in COMMAND_LINE_TARGETS: |
From: Jon H. <jon...@us...> - 2005-08-23 14:39:54
|
Update of /cvsroot/shallows/shallows/examples/simpleMRT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16992 Added Files: MRT.shader SConstruct showtexRect.shader simpleMRT.cpp Log Message: Added simple Multiple Render Targets example using rectangular textures --- NEW FILE: SConstruct --- # $Id: SConstruct,v 1.1 2005/08/23 14:39:45 jonhjelm Exp $ # This is the SConstruct file for the shallows-test suite # This must be called through the parent SConstruct file. #env = Environment( CPPPATH = ['#include/' ], LIBPATH = [ '#' ]) Import('env') conf = Configure( env.Copy() ) conf.env.Append( LIBPATH = [ '#' ] ) reqclibs = [ 'dl', 'glut' ] reqcxxlibs = [ 'shallows' , 'cppunit'] for lib in reqclibs: if not conf.CheckLib( lib ): print 'Did not find ' + lib + ' library. Aborting.' Exit( 1 ) for lib in reqcxxlibs: if not conf.CheckLib( lib, language='c++' ): print 'Did not find ' + lib + ' library. Aborting.' Exit( 1 ) import glob if conf.env['PLATFORM'] == 'posix': conf.env.Append( LINKFLAGS = '-pthread -Wl,--rpath=../../') env = conf.Finish() # All cpp files in this diretory will be built files = glob.glob('*.cpp') env.Program('simpleMRT', files) --- NEW FILE: simpleMRT.cpp --- #include <iostream> #include <stdlib.h> #include <GL/glut.h> #include "shallows/GLProgram.hpp" #include "shallows/OnScreenBuffer.hpp" #include "shallows/OnScreenRenderTarget.hpp" #include "boost/shared_ptr.hpp" #include "shallows/OffScreenBuffer.hpp" #include "shallows/RenderTexture2D.hpp" #include "shallows/utils/textureCreation.hpp" #include "shallows/GPGPURenderable.hpp" #include "shallows/shallowsexcept.hpp" using boost::shared_ptr; using shallows::Texture2D; using shallows::GLProgram; using shallows::OffScreenBuffer; using shallows::RenderTexture2D; using shallows::OnScreenBuffer; using shallows::OnScreenRenderTarget; using shallows::GPGPURenderable; const unsigned int BUFF_DIM=256; shared_ptr<GLProgram> MRTProg; shared_ptr<GLProgram> displayProg[3]; int window_width; int window_height; shared_ptr<GPGPURenderable> renderable; shared_ptr<GPGPURenderable> init_tex_renderable; int RTtodisplay=1; void reshape(int width, int height) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(-0.5, 0.5, -0.5, 0.5); glViewport(0,0,width,height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glScalef(1.0-0.5/width, 1.0-0.5/height, 1.0f); glTranslatef(-0.5f, -0.5f, 0.0f); } void reshape_callback(int width, int height) { window_width=width; window_height=height; reshape(window_width, window_height); } void keyboard(unsigned char key, int winx, int winy) { switch(key) { case '0': RTtodisplay=0; break; case '1': RTtodisplay=1; break; case '2': RTtodisplay=2; break; case 'q': exit(0); } } void initOpengl() { renderable.reset(new GPGPURenderable); renderable->setTexCoordInterval(0.0, BUFF_DIM, 0.0, BUFF_DIM); init_tex_renderable.reset(new GPGPURenderable); init_tex_renderable->setTexCoordInterval(0.0, 4.0, 0.0, 4.0); float pixels[]={0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; boost::shared_ptr<Texture2D> init_tex= shallows::utils::createFloatTextureRectangle(4, 4, 4, pixels); // shared_ptr<OffScreenBuffer> fb(new OffScreenBuffer(BUFF_DIM, BUFF_DIM)); shared_ptr<OffScreenBuffer> fb(new OffScreenBuffer( init_tex->getInternalFormat(), BUFF_DIM, BUFF_DIM)); shared_ptr<RenderTexture2D> rt[3]; rt[0]=fb->createRenderTextureRectangle(); rt[1]=fb->createRenderTextureRectangle(); rt[2]=fb->createRenderTextureRectangle(); glDisable(GL_DEPTH_TEST); MRTProg.reset(new GLProgram); MRTProg->readFile("MRT.shader"); MRTProg->setFrameBuffer(fb); MRTProg->setOutputTarget(0, rt[0]); MRTProg->setOutputTarget(1, rt[1]); MRTProg->setOutputTarget(2, rt[2]); MRTProg->setInputTexture("texture", init_tex); MRTProg->setRenderable(init_tex_renderable); shared_ptr<OnScreenBuffer> ons_fb(new OnScreenBuffer); shared_ptr<OnScreenRenderTarget> ons_rt (new OnScreenRenderTarget(GL_BACK_LEFT)); for (int i=0; i<3; i++) { displayProg[i].reset(new GLProgram); displayProg[i]->readFile("showtexRect.shader"); displayProg[i]->setFrameBuffer(ons_fb); displayProg[i]->setOutputTarget(0, ons_rt); displayProg[i]->setInputTexture("texture", rt[i]->getTexture()); //displayProg->setInputTexture("texture", init_tex); displayProg[i]->setRenderable(renderable); } } void display() { try { reshape(BUFF_DIM, BUFF_DIM); MRTProg->run(); reshape(window_width, window_height); displayProg[RTtodisplay]->run(); } catch (std::exception &e) { std::cout << e.what() << std::endl; exit(0); } glutSwapBuffers(); glutPostRedisplay(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitWindowPosition(100, 100); glutInitWindowSize(512, 512); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); int windowID = glutCreateWindow("SimpleHeat using shallows"); glutSetWindow(windowID); glutReshapeFunc(reshape_callback); glutKeyboardFunc(keyboard); glutDisplayFunc(display); try { initOpengl(); } catch (shallows::compile_error &e) { std::cout << "Compile error:\n " << e.log() << std::endl; exit(0); } catch (std::exception &e) { std::cout << e.what() << std::endl; exit(0); } glutMainLoop(); return 0; } --- NEW FILE: MRT.shader --- // -*-C++-*- [Vertex shader] void main () { gl_Position = ftransform(); gl_TexCoord[0]=gl_MultiTexCoord0; } [Fragment shader] uniform sampler2DRect texture; void main () { vec4 u = texture2DRect(texture, gl_TexCoord[0].xy); gl_FragData[0] = u+1.0*vec4(0.0, 1.0, 0.0, 0.0); gl_FragData[1] = u+1.0*vec4(0.0, 1.0, 1.0, 0.0); gl_FragData[2] = u+1.0*vec4(0.0, 0.0, 1.0, 0.0); } --- NEW FILE: showtexRect.shader --- // -*-C++-*- [Vertex shader] void main () { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; gl_TexCoord[0]=gl_MultiTexCoord0; } [Fragment shader] uniform sampler2DRect texture; void main () { vec4 col=texture2DRect(texture, gl_TexCoord[0].xy); gl_FragColor = col; } |
From: Jon H. <jon...@us...> - 2005-08-23 14:37:19
|
Update of /cvsroot/shallows/shallows/examples/simpleMRT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16297/examples/simpleMRT Log Message: Directory /cvsroot/shallows/shallows/examples/simpleMRT added to the repository |
From: Jon H. <jon...@us...> - 2005-08-23 14:35:51
|
Update of /cvsroot/shallows/shallows/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15961/test Modified Files: FrameBufferTest.cpp FrameBufferTest.hpp Log Message: Tests MRT Index: FrameBufferTest.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/test/FrameBufferTest.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FrameBufferTest.hpp 14 Jul 2005 09:29:22 -0000 1.3 --- FrameBufferTest.hpp 23 Aug 2005 14:35:40 -0000 1.4 *************** *** 14,17 **** --- 14,18 ---- CPPUNIT_TEST( deactivate ); CPPUNIT_TEST( attach2DTexture ); + CPPUNIT_TEST( MRT ); CPPUNIT_TEST( validateCompleteness ); CPPUNIT_TEST_SUITE_END(); *************** *** 27,30 **** --- 28,32 ---- void deactivate(); void attach2DTexture(); + void MRT(); void validateCompleteness(); Index: FrameBufferTest.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/test/FrameBufferTest.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FrameBufferTest.cpp 19 Jul 2005 11:15:52 -0000 1.11 --- FrameBufferTest.cpp 23 Aug 2005 14:35:40 -0000 1.12 *************** *** 44,48 **** using namespace std; ! namespace test { --- 44,48 ---- using namespace std; ! using boost::shared_ptr; namespace test { *************** *** 113,116 **** --- 113,128 ---- } + void FrameBufferTest::MRT() { + shared_ptr<shallows::OffScreenBuffer> + fb(new shallows::OffScreenBuffer(4, 4)); + shared_ptr<shallows::RenderTexture2D> rt[2]; + rt[0]=fb->createRenderTexture2D(); + rt[1]=fb->createRenderTexture2D(); + CPPUNIT_ASSERT_NO_THROW(fb->attachRenderTarget(*rt[0], 0)); + CPPUNIT_ASSERT_NO_THROW(fb->attachRenderTarget(*rt[1], 1)); + CPPUNIT_ASSERT_NO_THROW(fb->drawBuffers(2)); + // CPPUNIT_ASSERT_NO_THROW( shallows::FrameBuffer::activateWindowFrameBuffer()); + } + void FrameBufferTest::validateCompleteness() { { |
From: Jon H. <jon...@us...> - 2005-08-23 14:33:40
|
Update of /cvsroot/shallows/shallows/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15470/src Modified Files: GLProgram.cpp GPGPURenderable.cpp OffScreenBuffer.cpp RenderTexture2D.cpp Texture2D.cpp textureCreation.cpp Log Message: Continued implementation concerning rectangular textures and MRT Index: textureCreation.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/textureCreation.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** textureCreation.cpp 14 Jul 2005 09:28:22 -0000 1.2 --- textureCreation.cpp 23 Aug 2005 14:33:30 -0000 1.3 *************** *** 36,39 **** --- 36,40 ---- using namespace shallows; + using boost::shared_ptr; namespace shallows { *************** *** 72,75 **** --- 73,110 ---- + shared_ptr<Texture2D> createFloatTextureRectangle(unsigned int width, + unsigned int height, + unsigned int components, + const float *pixels) + { + boost::shared_ptr<Texture2D> tex; + if (components ==4) + { + tex.reset(new shallows::Texture2D (GL_FLOAT_RGBA32_NV, + width, height, + GL_RGBA, + GL_FLOAT, + pixels, + true)); + } else + { + std::string s; + s = __FILE__; + s += "line: "; + s += __LINE__; + s += "createFloatTextureRectangle not implemented for " + components; + s += " number of components"; + throw not_implemented(s); + } + tex->bind(); + glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + return tex; + } + + } // namespace shallows::utils } //namespace utils Index: GLProgram.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/GLProgram.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GLProgram.cpp 23 Aug 2005 09:03:19 -0000 1.16 --- GLProgram.cpp 23 Aug 2005 14:33:30 -0000 1.17 *************** *** 174,178 **** if (renderTargets_[i].get()!=0) { ! if (numRenderTargets!= i-1 && i>0) { throw std::runtime_error("Missing rendertargets"); --- 174,178 ---- if (renderTargets_[i].get()!=0) { ! if (numRenderTargets!= i) { throw std::runtime_error("Missing rendertargets"); *************** *** 193,196 **** --- 193,197 ---- } else { + unsigned int* pntr=frameBuffer_->drawBuffers(numRenderTargets); glDrawBuffers(numRenderTargets, frameBuffer_->drawBuffers(numRenderTargets)); Index: OffScreenBuffer.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/OffScreenBuffer.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OffScreenBuffer.cpp 19 Jul 2005 13:25:10 -0000 1.6 --- OffScreenBuffer.cpp 23 Aug 2005 14:33:30 -0000 1.7 *************** *** 36,39 **** --- 36,40 ---- #include "shallows/RenderTexture2D.hpp" #include "shallows/OffScreenRenderTarget.hpp" + using namespace shallows::internal; *************** *** 48,52 **** OffScreenBuffer::OffScreenBuffer(int internalFormat, unsigned int width, unsigned int height) : ! height_(0), width_(0), internalFormat_(0), id_(0) { init(internalFormat_, width, height); --- 49,53 ---- OffScreenBuffer::OffScreenBuffer(int internalFormat, unsigned int width, unsigned int height) : ! height_(0), width_(0), internalFormat_(internalFormat), id_(0) { init(internalFormat_, width, height); *************** *** 97,126 **** throw ; } - /* - glGenFramebuffersEXT(1, &id_); - setInternalFormat(t); - CHECK_GL_DEBUG; - int max_draw_buffers; - glGetIntegerv(GL_MAX_DRAW_BUFFERS, &max_draw_buffers); - int max_color_attachments; - glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments); - if (max_draw_buffers>max_color_attachments) - max_draw_buffers=max_color_attachments; - drawBuffers_.resize(max_draw_buffers); - for (unsigned int i=0; i<max_draw_buffers; i++) - { - drawBuffers_[i]=static_cast<unsigned int> (GL_COLOR_ATTACHMENT0_EXT)+i; - } - */ - /* - GLuint depth_rb; - glGenRenderbuffersEXT(1, &depth_rb); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_rb); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, - width_, height_); - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, id_); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_rb); - */ } OffScreenBuffer::~OffScreenBuffer() --- 98,103 ---- throw ; } } + OffScreenBuffer::~OffScreenBuffer() *************** *** 130,134 **** } ! boost::shared_ptr<RenderTexture2D> OffScreenBuffer::createRenderTexture2D() { boost::shared_ptr<Texture2D> tex; --- 107,112 ---- } ! boost::shared_ptr<RenderTexture2D> ! OffScreenBuffer::createRenderTexture2D() { boost::shared_ptr<Texture2D> tex; *************** *** 148,152 **** CHECK_GL_DEBUG; return rt; ! } --- 126,153 ---- CHECK_GL_DEBUG; return rt; ! } ! ! boost::shared_ptr<RenderTexture2D> ! OffScreenBuffer::createRenderTextureRectangle() ! { ! boost::shared_ptr<Texture2D> tex; ! tex.reset(new Texture2D(internalFormat_, ! width_, ! height_, ! GL_RGBA, ! GL_FLOAT, ! 0, ! true)); ! tex->bind(); ! glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); ! glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); ! glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, ! GL_TEXTURE_MIN_FILTER, GL_NEAREST); ! glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, ! GL_TEXTURE_MAG_FILTER, GL_NEAREST); ! ! boost::shared_ptr<RenderTexture2D> rt(new RenderTexture2D(tex)); ! CHECK_GL_DEBUG; ! return rt; } *************** *** 304,307 **** --- 305,309 ---- } + void OffScreenBuffer::operator=(const OffScreenBuffer &b) { ; } Index: RenderTexture2D.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/RenderTexture2D.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RenderTexture2D.cpp 19 Jul 2005 13:35:34 -0000 1.4 --- RenderTexture2D.cpp 23 Aug 2005 14:33:30 -0000 1.5 *************** *** 51,57 **** void RenderTexture2D::bindToCurrentFrameBuffer(unsigned int colBufId) { ! glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, ! GL_COLOR_ATTACHMENT0_EXT+colBufId, ! GL_TEXTURE_2D, texture_->getTextureID(), 0); } --- 51,66 ---- void RenderTexture2D::bindToCurrentFrameBuffer(unsigned int colBufId) { ! if (texture_->isRectangular()) ! { ! glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, ! GL_COLOR_ATTACHMENT0_EXT+colBufId, ! GL_TEXTURE_RECTANGLE_ARB, ! texture_->getTextureID(), 0); ! } else ! { ! glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, ! GL_COLOR_ATTACHMENT0_EXT+colBufId, ! GL_TEXTURE_2D, texture_->getTextureID(), 0); ! } } Index: GPGPURenderable.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/GPGPURenderable.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GPGPURenderable.cpp 14 Jul 2005 09:29:02 -0000 1.1 --- GPGPURenderable.cpp 23 Aug 2005 14:33:30 -0000 1.2 *************** *** 34,38 **** { ! GPGPURenderable::GPGPURenderable() { ; } --- 34,39 ---- { ! GPGPURenderable::GPGPURenderable() : ! min_u_(0.0), max_u_(1.0), min_v_(0.0), max_v_(1.0) { ; } *************** *** 40,56 **** { ; } void GPGPURenderable::render() const { glBegin(GL_QUADS); ! glTexCoord2f(0.0, 0.0); glVertex3f(0.0f, 0.0f, 0.5f); ! glTexCoord2f(1.0, 0.0); glVertex3f(1.0f, 0.0f, 0.5f); ! glTexCoord2f(1.0, 1.0); glVertex3f(1.0f, 1.0f, 0.5f); ! glTexCoord2f(0.0, 1.0); glVertex3f(0.0f, 1.0f, 0.5f); glEnd(); --- 41,67 ---- { ; } + void GPGPURenderable::setTexCoordInterval(float min_u, float max_u, + float min_v, float max_v) + { + min_u_ = min_u; + max_u_ = max_u; + min_v_ = min_v; + max_v_ = max_v; + } + + void GPGPURenderable::render() const { glBegin(GL_QUADS); ! glTexCoord2f(min_u_, min_v_); glVertex3f(0.0f, 0.0f, 0.5f); ! glTexCoord2f(max_u_, min_v_); glVertex3f(1.0f, 0.0f, 0.5f); ! glTexCoord2f(max_u_, max_v_); glVertex3f(1.0f, 1.0f, 0.5f); ! glTexCoord2f(min_u_, max_v_); glVertex3f(0.0f, 1.0f, 0.5f); glEnd(); Index: Texture2D.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/Texture2D.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Texture2D.cpp 19 Jul 2005 11:02:06 -0000 1.6 --- Texture2D.cpp 23 Aug 2005 14:33:30 -0000 1.7 *************** *** 40,44 **** int format, int type, ! const void *pixels) : Texture() { internalFormat_ = internalFormat; --- 40,45 ---- int format, int type, ! const void *pixels, ! bool rectanguar) : Texture(), rectanguar_(rectanguar) { internalFormat_ = internalFormat; *************** *** 46,54 **** height_ = height; ! glBindTexture(GL_TEXTURE_2D, textureID_); ! glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, ! 0, format, (GLenum) type, pixels); ! try { --- 47,63 ---- height_ = height; ! if (rectanguar_==false) ! { ! glBindTexture(GL_TEXTURE_2D, textureID_); ! glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, ! 0, format, (GLenum) type, pixels); ! } else ! { ! glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textureID_); ! ! glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, internalFormat, width, height, ! 0, format, (GLenum) type, pixels); ! } try { *************** *** 73,76 **** --- 82,90 ---- + bool Texture2D::isRectangular() const + { + return rectanguar_; + } + unsigned int Texture2D::getHeight() const { *************** *** 91,104 **** void Texture2D::bind() const { ! glBindTexture(GL_TEXTURE_2D, textureID_); } void Texture2D::validateSamplerType(const std::string &s) const { ! if (s!="sampler2D") { ! std::string str = "Texture2D attempted to bound to sampler type "; ! str += s; ! throw std::invalid_argument( str ); } } --- 105,132 ---- void Texture2D::bind() const { ! if (rectanguar_) ! glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textureID_); ! else ! glBindTexture(GL_TEXTURE_2D, textureID_); } void Texture2D::validateSamplerType(const std::string &s) const { ! if (rectanguar_) { ! if (s!="sampler2DRect") ! { ! std::string str = "TextureRectangle attempted to bound to sampler type "; ! str += s; ! throw std::invalid_argument( str ); ! } ! } else ! { ! if (s!="sampler2D") ! { ! std::string str = "Texture2D attempted to bound to sampler type "; ! str += s; ! throw std::invalid_argument( str ); ! } } } |
From: Jon H. <jon...@us...> - 2005-08-23 14:33:39
|
Update of /cvsroot/shallows/shallows/include/shallows/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15470/include/shallows/utils Modified Files: textureCreation.hpp Log Message: Continued implementation concerning rectangular textures and MRT Index: textureCreation.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/utils/textureCreation.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** textureCreation.hpp 11 Jul 2005 14:50:06 -0000 1.1 --- textureCreation.hpp 23 Aug 2005 14:33:30 -0000 1.2 *************** *** 34,37 **** --- 34,38 ---- namespace shallows { class Texture2D; + //class TextureRectangle; namespace utils{ *************** *** 41,44 **** --- 42,51 ---- const float *pixels); + boost::shared_ptr<Texture2D> + createFloatTextureRectangle(unsigned int width, + unsigned int height, + unsigned int components, + const float *pixels); + } // namespace shallows::utils |
From: Jon H. <jon...@us...> - 2005-08-23 14:33:39
|
Update of /cvsroot/shallows/shallows/include/shallows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15470/include/shallows Modified Files: GPGPURenderable.hpp OffScreenBuffer.hpp Texture2D.hpp Log Message: Continued implementation concerning rectangular textures and MRT Index: OffScreenBuffer.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/OffScreenBuffer.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OffScreenBuffer.hpp 18 Jul 2005 15:16:28 -0000 1.3 --- OffScreenBuffer.hpp 23 Aug 2005 14:33:30 -0000 1.4 *************** *** 49,53 **** OffScreenBuffer(Texture2D &t); virtual ~OffScreenBuffer(); ! virtual boost::shared_ptr<RenderTexture2D> createRenderTexture2D(); virtual void attachRenderTarget(RenderTarget &r, unsigned int colBufId); virtual void validateRenderTarget(const shallows::RenderTarget &r); --- 49,55 ---- OffScreenBuffer(Texture2D &t); virtual ~OffScreenBuffer(); ! virtual boost::shared_ptr<RenderTexture2D> createRenderTexture2D(); ! virtual boost::shared_ptr<RenderTexture2D> ! createRenderTextureRectangle(); virtual void attachRenderTarget(RenderTarget &r, unsigned int colBufId); virtual void validateRenderTarget(const shallows::RenderTarget &r); Index: GPGPURenderable.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/GPGPURenderable.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GPGPURenderable.hpp 14 Jul 2005 09:30:14 -0000 1.1 --- GPGPURenderable.hpp 23 Aug 2005 14:33:30 -0000 1.2 *************** *** 41,45 **** --- 41,51 ---- GPGPURenderable(); ~GPGPURenderable(); + void setTexCoordInterval(float min_u, float max_u, float min_v, float max_v); virtual void render() const; + protected: + float min_u_; + float max_u_; + float min_v_; + float max_v_; }; // class GPGPURenderable } // namespace shallows Index: Texture2D.hpp =================================================================== RCS file: /cvsroot/shallows/shallows/include/shallows/Texture2D.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Texture2D.hpp 14 Jul 2005 09:21:34 -0000 1.5 --- Texture2D.hpp 23 Aug 2005 14:33:30 -0000 1.6 *************** *** 40,51 **** Texture2D(int internalFormat, ! unsigned int width, ! unsigned int height, ! int format, ! int type, ! const void *pixels); ! virtual ~Texture2D(); unsigned int getWidth() const; unsigned int getHeight() const; --- 40,53 ---- Texture2D(int internalFormat, ! unsigned int width, ! unsigned int height, ! int format, ! int type, ! const void *pixels, ! bool rectanguar=false); ! virtual ~Texture2D(); + bool isRectangular() const; unsigned int getWidth() const; unsigned int getHeight() const; *************** *** 59,62 **** --- 61,65 ---- unsigned int width_; int internalFormat_; + bool rectanguar_; }; // Texture2D |
From: Jon H. <jon...@us...> - 2005-08-23 14:31:38
|
Update of /cvsroot/shallows/shallows/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14791/src Modified Files: shallows.cpp Log Message: removed console output on gl errors Index: shallows.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/src/shallows.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shallows.cpp 13 Jul 2005 10:09:57 -0000 1.3 --- shallows.cpp 23 Aug 2005 14:30:34 -0000 1.4 *************** *** 16,24 **** using std::endl; const GLenum err = glGetError(); ! if ( err != GL_NO_ERROR ) { ! if ( line != 0 ) ! cerr << s << ": at line: " << line << " "; ! cerr << "OpenGL error: " << gluErrorString( err ) << endl; ! throw std::runtime_error( "OpenGL Error!" ); } } --- 16,24 ---- using std::endl; const GLenum err = glGetError(); ! if ( err != GL_NO_ERROR ) { ! // if ( line != 0 ) ! // cerr << s << ": at line: " << line << " "; ! // cerr << "OpenGL error: " << gluErrorString( err ) << endl; ! throw std::runtime_error( "OpenGL Error!" ); } } *************** *** 30,38 **** using std::endl; const CGerror err = cgGetError(); ! if ( err != CG_NO_ERROR ) { ! if ( line != 0 ) ! cerr << s << ": at line: " << line << " "; ! cerr << "Cg-runtime error: " << cgGetErrorString( err ) << endl; ! throw std::runtime_error( "Cg-runtime Error!" ); } #endif --- 30,38 ---- using std::endl; const CGerror err = cgGetError(); ! if ( err != CG_NO_ERROR ) { ! // if ( line != 0 ) ! // cerr << s << ": at line: " << line << " "; ! // cerr << "Cg-runtime error: " << cgGetErrorString( err ) << endl; ! throw std::runtime_error( "Cg-runtime Error!" ); } #endif |
From: Johan S. <jo...@us...> - 2005-08-23 12:21:41
|
Update of /cvsroot/shallows/shallows/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14513/test Modified Files: ImageTest.cpp Log Message: Now uses the new 16bit-Lena image for png testing. Index: ImageTest.cpp =================================================================== RCS file: /cvsroot/shallows/shallows/test/ImageTest.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ImageTest.cpp 18 Jul 2005 14:37:34 -0000 1.3 --- ImageTest.cpp 23 Aug 2005 12:20:42 -0000 1.4 *************** *** 118,124 **** CPPUNIT_ASSERT_NO_THROW( shallows::internal::genPngImage<char>( "images/www.png", 4 ) ); CPPUNIT_ASSERT_NO_THROW( shallows::internal::genPngImage<int>( "images/www.png", 4 ) ); ! // Johan is 16 ! CPPUNIT_ASSERT_NO_THROW( shallows::internal::genPngImage<short>( "images/johan.png", 4 ) ); ! CPPUNIT_ASSERT_NO_THROW( shallows::internal::genPngImage<char>( "images/johan.png", 4 ) ); #else CPPUNIT_FAIL( "shallows is not compiled with pnglib support, so test can not be run. " ); --- 118,126 ---- CPPUNIT_ASSERT_NO_THROW( shallows::internal::genPngImage<char>( "images/www.png", 4 ) ); CPPUNIT_ASSERT_NO_THROW( shallows::internal::genPngImage<int>( "images/www.png", 4 ) ); ! // lena-color-512x512-16bit.png is 16bit png (obviously :-) ) ! ! const string lena = "images/lena-color-512x512-16bit.png"; ! CPPUNIT_ASSERT_NO_THROW( shallows::internal::genPngImage<short>( lena, 4 ) ); ! CPPUNIT_ASSERT_NO_THROW( shallows::internal::genPngImage<char>( lena, 4 ) ); #else CPPUNIT_FAIL( "shallows is not compiled with pnglib support, so test can not be run. " ); *************** *** 136,143 **** typedef short Small; typedef int Large; ! // johan is 16-bit png ! shared_ptr<Image<Small> > smallimg = genPngImage<Small>( "images/johan.png", 4 ); ! ! shared_ptr<Image<Large> > largeimg = genPngImage<Large>( "images/johan.png", 4 ); /* CPPUNIT_ASSERT( equal( smallimg->data_.begin(), smallimg->data_.end(), --- 138,146 ---- typedef short Small; typedef int Large; ! // This is 16-bit version of lena ! const string lena = "images/lena-color-512x512-16bit.png"; ! ! shared_ptr<Image<Small> > smallimg = genPngImage<Small>( lena, 4 ); ! shared_ptr<Image<Large> > largeimg = genPngImage<Large>( lena, 4 ); /* CPPUNIT_ASSERT( equal( smallimg->data_.begin(), smallimg->data_.end(), |
From: Johan S. <jo...@us...> - 2005-08-23 12:12:40
|
Update of /cvsroot/shallows/shallows/test/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12407/test/images Added Files: lena-color-512x512-16bit.png Log Message: Added 16-bit version of Lena image. --- NEW FILE: lena-color-512x512-16bit.png --- (This appears to be a binary file; contents omitted.) |
From: Johan S. <jo...@us...> - 2005-08-23 11:21:40
|
Update of /cvsroot/shallows/shallows/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2163/test Modified Files: SConstruct Log Message: *** keyword substitution change *** |