Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/OpenGL/OpenGLShader.cpp @ 1619:4c9e68291467
Added code to remove the wheel callback in dtor, to prevent access to dead object
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 02 Nov 2020 17:55:35 +0100 |
parents | 8563ea5d8ae4 |
children | 59f95b9ea858 |
rev | line source |
---|---|
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
956
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
15 * Lesser General Public License for more details. |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
16 * |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
18 * License along with this program. If not, see |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 **/ |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 #include "OpenGLShader.h" |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
25 #include <OrthancException.h> |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 namespace OrthancStone |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 { |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 namespace OpenGL |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 { |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 static GLuint CompileShader(GLenum type, |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 const std::string& source) |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 { |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 // Create shader object |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 const GLchar* sourceString[1]; |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 GLint sourceStringLengths[1]; |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 sourceString[0] = source.c_str(); |
701
58e1faeafb1b
Fixed truncating conversion warning
Benjamin Golinvaux <bgo@osimis.io>
parents:
599
diff
changeset
|
39 sourceStringLengths[0] = static_cast<GLint>(source.length()); |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 GLuint shader = glCreateShader(type); |
947
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
41 ORTHANC_OPENGL_CHECK("glCreateShader"); |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 if (shader == 0) |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 { |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 "Cannot create an OpenGL shader"); |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 else |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 { |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 // Assign and compile the source to the shader object |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 glShaderSource(shader, 1, sourceString, sourceStringLengths); |
947
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
52 ORTHANC_OPENGL_CHECK("glShaderSource"); |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 glCompileShader(shader); |
947
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
54 ORTHANC_OPENGL_CHECK("glCompileShader"); |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 // Check if there were errors |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 int infoLen = 0; |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); |
947
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
59 ORTHANC_OPENGL_CHECK("glGetShaderiv"); |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 |
599 | 61 if (infoLen > 1) // Might be equal to 1, which amounts to no error |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 { |
584
434ceeb0bcab
layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
579
diff
changeset
|
63 std::string infoLog; |
434ceeb0bcab
layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
579
diff
changeset
|
64 infoLog.resize(infoLen + 1); |
434ceeb0bcab
layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
579
diff
changeset
|
65 glGetShaderInfoLog(shader, infoLen, NULL, &infoLog[0]); |
947
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
66 ORTHANC_OPENGL_CHECK("glGetShaderInfoLog"); |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
67 ORTHANC_OPENGL_TRACE_CURRENT_CONTEXT("About to call glDeleteShader"); |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 glDeleteShader(shader); |
947
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
69 ORTHANC_OPENGL_CHECK("glDeleteShader"); |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
584
434ceeb0bcab
layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
579
diff
changeset
|
72 "Error while creating an OpenGL shader: " + infoLog); |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 else |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 { |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 return shader; |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 OpenGLShader::OpenGLShader(GLenum type, |
1571 | 83 const std::string& source) : |
84 shader_(CompileShader(type, source)) | |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 { |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 isValid_ = true; |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 OpenGLShader::~OpenGLShader() |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 { |
947
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
92 try |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
93 { |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
94 if (isValid_) |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
95 { |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
96 ORTHANC_OPENGL_TRACE_CURRENT_CONTEXT("About to call glDeleteShader"); |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
97 glDeleteShader(shader_); |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
98 ORTHANC_OPENGL_CHECK("glDeleteShader"); |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
99 } |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
100 } |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
101 catch (const Orthanc::OrthancException& e) |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 { |
947
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
103 if (e.HasDetails()) |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
104 { |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
105 LOG(ERROR) << "OrthancException in ~OpenGLShader: " << e.What() << " Details: " << e.GetDetails(); |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
106 } |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
107 else |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
108 { |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
109 LOG(ERROR) << "OrthancException in ~OpenGLShader: " << e.What(); |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
110 } |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
111 } |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
112 catch (const std::exception& e) |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
113 { |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
114 LOG(ERROR) << "std::exception in ~OpenGLShader: " << e.what(); |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
115 } |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
116 catch (...) |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
117 { |
1091b2adeb5a
Fixed animation frame stopping when returning false + big work on the OpenGL
Benjamin Golinvaux <bgo@osimis.io>
parents:
701
diff
changeset
|
118 LOG(ERROR) << "Unknown exception in ~OpenGLShader"; |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 GLuint OpenGLShader::Release() |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 { |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 if (isValid_) |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 { |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 isValid_ = false; |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 return shader_; |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 else |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 { |
956
a7351ad54960
Made IsContextLost automatically set the flag by checking with the emscripten
Benjamin Golinvaux <bgo@osimis.io>
parents:
947
diff
changeset
|
131 LOG(ERROR) << "OpenGLShader::Release(): (!isValid_)"; |
578
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 } |
21fd70df3fc9
starting work on OpenGL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 } |