Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/OpenGL/OpenGLTexture.cpp @ 2061:6ea5f40ea0e9 deep-learning
added ImageProcessingProgram
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 May 2023 16:34:34 +0200 |
parents | 86e0e92a2e0d |
children | fdb012c86a75 |
comparison
equal
deleted
inserted
replaced
2060:86e0e92a2e0d | 2061:6ea5f40ea0e9 |
---|---|
43 width_(0), | 43 width_(0), |
44 height_(0), | 44 height_(0), |
45 format_(Orthanc::PixelFormat_Grayscale8), | 45 format_(Orthanc::PixelFormat_Grayscale8), |
46 isLinearInterpolation_(false) | 46 isLinearInterpolation_(false) |
47 { | 47 { |
48 if (!context_.IsContextLost()) | 48 if (context.IsContextLost()) |
49 { | 49 { |
50 // Generate a texture object | 50 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
51 glGenTextures(1, &texture_); | 51 "OpenGL context has been lost"); |
52 ORTHANC_OPENGL_CHECK("glGenTextures()"); | 52 } |
53 | 53 |
54 if (texture_ == 0) | 54 // Generate a texture object |
55 { | 55 glGenTextures(1, &texture_); |
56 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, | 56 ORTHANC_OPENGL_CHECK("glGenTextures()"); |
57 "Cannot create an OpenGL texture"); | 57 |
58 } | 58 if (texture_ == 0) |
59 { | |
60 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, | |
61 "Cannot create an OpenGL texture"); | |
59 } | 62 } |
60 } | 63 } |
61 | 64 |
62 OpenGLTexture::~OpenGLTexture() | 65 OpenGLTexture::~OpenGLTexture() |
63 { | 66 { |