# ifndef GLX_GLXEXT_LEGACY
# define GLX_GLXEXT_LEGACY
# endif
+#ifdef __APPLE__
+#import <mach-o/dyld.h>
+#import <stdlib.h>
+#import <string.h>
+void * glXGetProcAddressARB (const GLubyte *name)
+
+{
+ NSSymbol symbol;
+ char *symbolName;
+ symbolName = (char *)malloc (strlen ((const char *)name) + 2); // 1
+ strcpy(symbolName + 1, (const char *)name); // 2
+ symbolName[0] = '_'; // 3
+ symbol = NULL;
+ if (NSIsSymbolNameDefined (symbolName)) // 4
+ symbol = NSLookupAndBindSymbol (symbolName);
+ free (symbolName); // 5
+ return symbol ? NSAddressOfSymbol (symbol) : NULL; // 6
+}
+#else
# include <GL/glx.h>
+#endif
# include <dlfcn.h>
#else
# include <wingdi.h>
this->OpenGLHelper.vglUseProgramObjectARB( this->PointProgram );
this->myLocations.ModelViewProjection = this->OpenGLHelper.vglGetUniformLocationARB( this->PointProgram, "uModelViewProjectionMatrix" );
+ this->myLocations.Projection = this->OpenGLHelper.vglGetUniformLocationARB( this->PointProgram, "uProjectionMatrix" );
this->myLocations.GeneralPointSize = this->OpenGLHelper.vglGetUniformLocationARB( this->PointProgram, "uGeneralPointSize" );
this->myLocations.PointSprite = this->OpenGLHelper.vglGetUniformLocationARB( this->PointProgram, "uPointSprite" );
std::string fileName = std::string( getenv( "GUI_ROOT_DIR") ) +
"/share/salome/resources/gui/Vertex_Program_ARB.txt";
- char* shader = readFromFile( fileName );
+ char* shader = GUI_OPENGL::readFromFile( fileName );
GLhandleARB VertexShader = this->OpenGLHelper.vglCreateShaderObjectARB( GL_VERTEX_SHADER_ARB );
this->OpenGLHelper.vglShaderSourceARB( VertexShader, 1, (const GLcharARB**)&shader, NULL );
QString anAlphaTexture = getenv( "GUI_ROOT_DIR" );
anAlphaTexture.append( "/share/salome/resources/gui/sprite_alpha.vti" );
- vtkSmartPointer<vtkImageData> aTextureValue = VTK::MakeTexture( aMainTexture.toLatin1().constData(), anAlphaTexture.toLatin1().constData() );
+ vtkSmartPointer<vtkImageData> aTextureValue = VTK::MakeTexture( aMainTexture.toUtf8().constData(), anAlphaTexture.toUtf8().constData() );
this->SpecialTextures[BallTextureId] = aTextureValue;
}
this->ImageData = this->SpecialTextures[BallTextureId];
virtual
void
get( TVertex& theVertex, vtkIdType thePointId, vtkIdType theCellId ) = 0;
+
+ virtual ~TColorFunctorBase() {}
};
//-----------------------------------------------------------------------------
}
int* aSize = this->ImageData->GetDimensions();
- //glPointSize( std::max( aSize[0], aSize[1] ) );
int aMode = 0; // to remove
{
{
this->OpenGLHelper.SetUniformMatrix( this->myLocations.ModelViewProjection, wcdc );
}
+ this->OpenGLHelper.SetUniformMatrix( this->myLocations.Projection, vcdc );
this->OpenGLHelper.vglUniform1iARB( this->myLocations.GeneralPointSize, std::max( aSize[0], aSize[1] ) );
#else
GLuint aBufferObjectID, aDiamsID = 0;
GLint attribute_diams = -1;
-
+ glPointSize( std::max( aSize[0], aSize[1] ) );
this->OpenGLHelper.vglGenBuffersARB( 1, &aBufferObjectID );
this->OpenGLHelper.vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aBufferObjectID );
this->OpenGLHelper.vglBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
this->OpenGLHelper.vglBindBufferARB( GL_ARRAY_BUFFER_ARB, aDiamsID );
- attribute_diams = vglGetAttribLocationARB(this->PointProgram, "diameter");
+ attribute_diams = this->OpenGLHelper.vglGetAttribLocationARB(this->PointProgram, "diameter");
this->OpenGLHelper.vglEnableVertexAttribArrayARB(attribute_diams);
this->OpenGLHelper.vglBindBufferARB(GL_ARRAY_BUFFER_ARB, aDiamsID);
this->OpenGLHelper.vglVertexAttribPointerARB(