mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:30:05 +00:00 
			
		
		
		
	Default geo_texture2d displayed parameter to true when not used
This commit is contained in:
		
							parent
							
								
									f4bc2572d2
								
							
						
					
					
						commit
						15beb9436d
					
				
					 7 changed files with 42 additions and 7 deletions
				
			
		|  | @ -137,6 +137,7 @@ void GeoLines::set_thresholded(bool thresholded) | ||||||
| void GeoLines::Initialize() | void GeoLines::Initialize() | ||||||
| { | { | ||||||
|    gl::OpenGLFunctions& gl   = p->context_->gl(); |    gl::OpenGLFunctions& gl   = p->context_->gl(); | ||||||
|  |    auto&                gl30 = p->context_->gl30(); | ||||||
| 
 | 
 | ||||||
|    p->shaderProgram_ = p->context_->GetShaderProgram( |    p->shaderProgram_ = p->context_->GetShaderProgram( | ||||||
|       {{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"}, |       {{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"}, | ||||||
|  | @ -215,6 +216,9 @@ void GeoLines::Initialize() | ||||||
|                              reinterpret_cast<void*>(1 * sizeof(GLint))); |                              reinterpret_cast<void*>(1 * sizeof(GLint))); | ||||||
|    gl.glEnableVertexAttribArray(6); |    gl.glEnableVertexAttribArray(6); | ||||||
| 
 | 
 | ||||||
|  |    // aDisplayed
 | ||||||
|  |    gl30.glVertexAttribI1i(7, 1); | ||||||
|  | 
 | ||||||
|    p->dirty_ = true; |    p->dirty_ = true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -162,6 +162,7 @@ void PlacefileIcons::set_thresholded(bool thresholded) | ||||||
| void PlacefileIcons::Initialize() | void PlacefileIcons::Initialize() | ||||||
| { | { | ||||||
|    gl::OpenGLFunctions& gl   = p->context_->gl(); |    gl::OpenGLFunctions& gl   = p->context_->gl(); | ||||||
|  |    auto&                gl30 = p->context_->gl30(); | ||||||
| 
 | 
 | ||||||
|    p->shaderProgram_ = p->context_->GetShaderProgram( |    p->shaderProgram_ = p->context_->GetShaderProgram( | ||||||
|       {{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"}, |       {{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"}, | ||||||
|  | @ -251,6 +252,9 @@ void PlacefileIcons::Initialize() | ||||||
|                              reinterpret_cast<void*>(1 * sizeof(GLint))); |                              reinterpret_cast<void*>(1 * sizeof(GLint))); | ||||||
|    gl.glEnableVertexAttribArray(6); |    gl.glEnableVertexAttribArray(6); | ||||||
| 
 | 
 | ||||||
|  |    // aDisplayed
 | ||||||
|  |    gl30.glVertexAttribI1i(7, 1); | ||||||
|  | 
 | ||||||
|    p->dirty_ = true; |    p->dirty_ = true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -140,6 +140,7 @@ void PlacefileImages::set_thresholded(bool thresholded) | ||||||
| void PlacefileImages::Initialize() | void PlacefileImages::Initialize() | ||||||
| { | { | ||||||
|    gl::OpenGLFunctions& gl   = p->context_->gl(); |    gl::OpenGLFunctions& gl   = p->context_->gl(); | ||||||
|  |    auto&                gl30 = p->context_->gl30(); | ||||||
| 
 | 
 | ||||||
|    p->shaderProgram_ = p->context_->GetShaderProgram( |    p->shaderProgram_ = p->context_->GetShaderProgram( | ||||||
|       {{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"}, |       {{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"}, | ||||||
|  | @ -220,6 +221,9 @@ void PlacefileImages::Initialize() | ||||||
|                              reinterpret_cast<void*>(1 * sizeof(GLint))); |                              reinterpret_cast<void*>(1 * sizeof(GLint))); | ||||||
|    gl.glEnableVertexAttribArray(6); |    gl.glEnableVertexAttribArray(6); | ||||||
| 
 | 
 | ||||||
|  |    // aDisplayed
 | ||||||
|  |    gl30.glVertexAttribI1i(7, 1); | ||||||
|  | 
 | ||||||
|    p->dirty_ = true; |    p->dirty_ = true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -132,6 +132,7 @@ void PlacefileLines::set_thresholded(bool thresholded) | ||||||
| void PlacefileLines::Initialize() | void PlacefileLines::Initialize() | ||||||
| { | { | ||||||
|    gl::OpenGLFunctions& gl   = p->context_->gl(); |    gl::OpenGLFunctions& gl   = p->context_->gl(); | ||||||
|  |    auto&                gl30 = p->context_->gl30(); | ||||||
| 
 | 
 | ||||||
|    p->shaderProgram_ = p->context_->GetShaderProgram( |    p->shaderProgram_ = p->context_->GetShaderProgram( | ||||||
|       {{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"}, |       {{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"}, | ||||||
|  | @ -209,6 +210,9 @@ void PlacefileLines::Initialize() | ||||||
|                              reinterpret_cast<void*>(1 * sizeof(GLint))); |                              reinterpret_cast<void*>(1 * sizeof(GLint))); | ||||||
|    gl.glEnableVertexAttribArray(6); |    gl.glEnableVertexAttribArray(6); | ||||||
| 
 | 
 | ||||||
|  |    // aDisplayed
 | ||||||
|  |    gl30.glVertexAttribI1i(7, 1); | ||||||
|  | 
 | ||||||
|    p->dirty_ = true; |    p->dirty_ = true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -32,6 +32,7 @@ public: | ||||||
|    GetShaderKey(std::initializer_list<std::pair<GLenum, std::string>> shaders); |    GetShaderKey(std::initializer_list<std::pair<GLenum, std::string>> shaders); | ||||||
| 
 | 
 | ||||||
|    gl::OpenGLFunctions  gl_; |    gl::OpenGLFunctions  gl_; | ||||||
|  |    QOpenGLFunctions_3_0 gl30_; | ||||||
| 
 | 
 | ||||||
|    bool glInitialized_ {false}; |    bool glInitialized_ {false}; | ||||||
| 
 | 
 | ||||||
|  | @ -56,6 +57,11 @@ gl::OpenGLFunctions& GlContext::gl() | ||||||
|    return p->gl_; |    return p->gl_; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | QOpenGLFunctions_3_0& GlContext::gl30() | ||||||
|  | { | ||||||
|  |    return p->gl30_; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| std::uint64_t GlContext::texture_buffer_count() const | std::uint64_t GlContext::texture_buffer_count() const | ||||||
| { | { | ||||||
|    return p->textureBufferCount_; |    return p->textureBufferCount_; | ||||||
|  | @ -68,6 +74,9 @@ void GlContext::Impl::InitializeGL() | ||||||
|       return; |       return; | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|  |    gl_.initializeOpenGLFunctions(); | ||||||
|  |    gl30_.initializeOpenGLFunctions(); | ||||||
|  | 
 | ||||||
|    gl_.glGenTextures(1, &textureAtlas_); |    gl_.glGenTextures(1, &textureAtlas_); | ||||||
| 
 | 
 | ||||||
|    glInitialized_ = true; |    glInitialized_ = true; | ||||||
|  | @ -122,6 +131,11 @@ GLuint GlContext::GetTextureAtlas() | ||||||
|    return p->textureAtlas_; |    return p->textureAtlas_; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void GlContext::Initialize() | ||||||
|  | { | ||||||
|  |    p->InitializeGL(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| std::size_t GlContext::Impl::GetShaderKey( | std::size_t GlContext::Impl::GetShaderKey( | ||||||
|    std::initializer_list<std::pair<GLenum, std::string>> shaders) |    std::initializer_list<std::pair<GLenum, std::string>> shaders) | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -3,6 +3,8 @@ | ||||||
| #include <scwx/qt/gl/gl.hpp> | #include <scwx/qt/gl/gl.hpp> | ||||||
| #include <scwx/qt/gl/shader_program.hpp> | #include <scwx/qt/gl/shader_program.hpp> | ||||||
| 
 | 
 | ||||||
|  | #include <QOpenGLFunctions_3_0> | ||||||
|  | 
 | ||||||
| namespace scwx | namespace scwx | ||||||
| { | { | ||||||
| namespace qt | namespace qt | ||||||
|  | @ -23,6 +25,7 @@ public: | ||||||
|    GlContext& operator=(GlContext&&) noexcept; |    GlContext& operator=(GlContext&&) noexcept; | ||||||
| 
 | 
 | ||||||
|    gl::OpenGLFunctions&  gl(); |    gl::OpenGLFunctions&  gl(); | ||||||
|  |    QOpenGLFunctions_3_0& gl30(); | ||||||
| 
 | 
 | ||||||
|    std::uint64_t texture_buffer_count() const; |    std::uint64_t texture_buffer_count() const; | ||||||
| 
 | 
 | ||||||
|  | @ -34,6 +37,8 @@ public: | ||||||
| 
 | 
 | ||||||
|    GLuint GetTextureAtlas(); |    GLuint GetTextureAtlas(); | ||||||
| 
 | 
 | ||||||
|  |    void Initialize(); | ||||||
|  | 
 | ||||||
| private: | private: | ||||||
|    class Impl; |    class Impl; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1325,7 +1325,7 @@ void MapWidget::initializeGL() | ||||||
|    logger_->debug("initializeGL()"); |    logger_->debug("initializeGL()"); | ||||||
| 
 | 
 | ||||||
|    makeCurrent(); |    makeCurrent(); | ||||||
|    p->context_->gl().initializeOpenGLFunctions(); |    p->context_->Initialize(); | ||||||
| 
 | 
 | ||||||
|    // Lock ImGui font atlas prior to new ImGui frame
 |    // Lock ImGui font atlas prior to new ImGui frame
 | ||||||
|    std::shared_lock imguiFontAtlasLock { |    std::shared_lock imguiFontAtlasLock { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat