MCPcopy Create free account
hub / github.com/Kitware/VTK / convertTypeToGL

Function convertTypeToGL

Rendering/OpenGL2/vtkOpenGLVertexArrayObject.cxx:23–51  ·  view source on GitHub ↗

Copied from vtkglShaderProgram, time to move into a common header?

Source from the content-addressed store, hash-verified

21{
22// Copied from vtkglShaderProgram, time to move into a common header?
23inline GLenum convertTypeToGL(int type)
24{
25 switch (type)
26 {
27 case VTK_CHAR:
28 return GL_BYTE;
29 case VTK_UNSIGNED_CHAR:
30 return GL_UNSIGNED_BYTE;
31 case VTK_SHORT:
32 return GL_SHORT;
33 case VTK_UNSIGNED_SHORT:
34 return GL_UNSIGNED_SHORT;
35 case VTK_INT:
36 return GL_INT;
37 case VTK_UNSIGNED_INT:
38 return GL_UNSIGNED_INT;
39 case VTK_FLOAT:
40 return GL_FLOAT;
41 case VTK_DOUBLE:
42#ifdef GL_DOUBLE
43 return GL_DOUBLE;
44#else
45 vtkGenericWarningMacro(<< "Attempt to use GL_DOUBLE when not supported");
46 return 0;
47#endif
48 default:
49 return 0;
50 }
51}
52
53struct VertexAttributes
54{

Calls

no outgoing calls

Tested by

no test coverage detected