VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGlShader.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 #pragma once
6 
10 
12 
13 #include <vrvMath/DtCommonTypes.h>
14 #include <vrvMath/DtDataFormat.h>
15 
16 #include <vector>
17 #include <string>
18 
19 namespace makVrv
20 {
21  class DtGlTexture;
22 
25  {
26  public:
28  {
29  VERTEX_SHADER = 0,
34  COMPUTE_SHADER
35  };
36  public:
38  DtGlShader(const std::string& name, const std::string& source, DtGlShaderType type);
39 
41  virtual ~DtGlShader();
42  private:
44  DtGlShader();
45 
47  DtGlShader(const DtGlShader&);
48 
50  DtGlShader& operator=(const DtGlShader&);
51  public:
53  virtual bool isValid() const;
54 
56  virtual unsigned int id() const;
57  public:
60  static std::string loadShaderSource(const std::string& strFileName, bool logWarning = true);
61 
63  static void saveShaderSource(const std::string& strFileName, const std::string& strSource);
64 
66  static std::string fixVersionDirective(const std::string &shaderString);
67 
69  static void deleteShaders(const std::vector<unsigned int>& shaderVector);
70 
74  static bool compileShader(const std::string& shader_name, const std::string& source, DtGlShaderType shaderType, unsigned int &shaderID);
75 
77  static void printGLSLInfoLog(unsigned int shader);
78 
79  protected:
80  unsigned int myShaderID;
81  bool myIsValid;
82  };
83 }
84 
Dll export defines.
A convenience class to represent an OpenGL Shader.
Definition: DtGlShader.h:24
Definition: DtGlShader.h:31
DtGlShaderType
Definition: DtGlShader.h:27
const char * source
Definition: lz4.h:442
Enumerations for various types of texture/buffer formats.
unsigned int myShaderID
Definition: DtGlShader.h:80
#define DT_DLL_VRVGRAPHICSUTILS
Definition: vrvGraphicsUtils.h:18
Definition: DtGlShader.h:32
bool myIsValid
Definition: DtGlShader.h:81
Definition: DtGlShader.h:33
Definition: DtGlShader.h:30

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)