MeVisLab Toolbox Reference
SoGLCompleteShader.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2009, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef SO_GLCOMPLETE_SHADER_H
14#define SO_GLCOMPLETE_SHADER_H
15
16
18
19#include "SoShaderSystem.h"
20#include <Inventor/SbBasic.h>
21#include <mlOpenGL.h>
22
23#include "SoGLShaderProgram.h"
24
26class SoGLTexture;
27
30{
31public:
36
37public:
39 : m_pVertSh(nullptr)
40 , m_pGeomSh(nullptr)
41 , m_pFragSh(nullptr)
42 {}
44
46 bool create(const char* srcVert, const char* srcGeom, const char* srcFrag);
48 bool update(const char* srcVert, const char* srcGeom, const char* srcFrag);
49
51 void bindTexture( const char* name, SoGLTexture* texture, int unit = -1);
52
54 void enable();
55
56};
57
58#endif // _SO_GLCOMPLETE_SHADER_
Shader class which directly takes src for vertex, geometry and/or fragment shader,...
SoGLShaderObject * m_pVertSh
The GLSL shader objects for vertex, geometry and fragment programs.
bool create(const char *srcVert, const char *srcGeom, const char *srcFrag)
Creates the shaders and links them. If one does not need a specific shader, just pass NULL.
void bindTexture(const char *name, SoGLTexture *texture, int unit=-1)
binds the given texture, if unit == -1 a unit is automatically assigned by the shader
SoGLShaderObject * m_pGeomSh
~SoGLCompleteShader() override
SoGLShaderObject * m_pFragSh
bool update(const char *srcVert, const char *srcGeom, const char *srcFrag)
Updates the shaders source. Pass NULL for shaders that you don't want to update.
void enable()
enables the shader, resets the assigned texture units
Vertex or fragment shader object class.
Class managing an OpenGL shader program.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.