diff --git a/CMakeLists.txt b/CMakeLists.txt index d87f1d47..2534c64a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,7 @@ file(GLOB HEADERS "*.h" "simulation/*.h" "scene/*.h" "rendering/*.h" +"rendering/opengl46/*.h" "audio/*.h" "environment/*.h" "application/*.h" @@ -327,13 +328,13 @@ endif() if (WITH_OPENGL_MODERN) set(SOURCES ${SOURCES} - "rendering/opengl33geometrybank.cpp" - "rendering/opengl33light.cpp" - "rendering/opengl33skydome.cpp" - "rendering/opengl33precipitation.cpp" - "rendering/opengl33particles.cpp" - "rendering/opengl33terrain.cpp" - "rendering/opengl33renderer.cpp") + "rendering/opengl46/opengl46geometrybank.cpp" + "rendering/opengl46/opengl46light.cpp" + "rendering/opengl46/opengl46skydome.cpp" + "rendering/opengl46/opengl46precipitation.cpp" + "rendering/opengl46/opengl46particles.cpp" + "rendering/opengl46/opengl46terrain.cpp" + "rendering/opengl46/opengl46renderer.cpp") set(DEFINITIONS ${DEFINITIONS} "WITH_OPENGL_MODERN") endif() diff --git a/environment/sky.h b/environment/sky.h index 94f3245f..da3f6c5a 100644 --- a/environment/sky.h +++ b/environment/sky.h @@ -14,7 +14,7 @@ http://mozilla.org/MPL/2.0/. class TSky { - friend opengl33_renderer; + friend opengl46_renderer; public: TSky() = default; diff --git a/environment/stars.h b/environment/stars.h index 393b3f6c..807af037 100644 --- a/environment/stars.h +++ b/environment/stars.h @@ -8,7 +8,7 @@ class cStars { - friend opengl33_renderer; + friend opengl46_renderer; public: // types: diff --git a/model/AnimModel.h b/model/AnimModel.h index fdec3cff..859c3f38 100644 --- a/model/AnimModel.h +++ b/model/AnimModel.h @@ -107,7 +107,7 @@ class TAnimContainer : public std::enable_shared_from_this // opakowanie modelu, określające stan egzemplarza class TAnimModel : public scene::basic_node { - friend opengl33_renderer; + friend opengl46_renderer; friend itemproperties_panel; public: diff --git a/model/Model3d.h b/model/Model3d.h index 6ee06a32..cd472b69 100644 --- a/model/Model3d.h +++ b/model/Model3d.h @@ -56,7 +56,7 @@ class TSubModel { // klasa submodelu - pojedyncza siatka, punkt świetlny albo grupa punktów //m7todo: zrobić normalną serializację - friend opengl33_renderer; + friend opengl46_renderer; friend TModel3d; // temporary workaround. TODO: clean up class content/hierarchy friend TDynamicObject; // temporary etc friend scene::shape_node; // temporary etc @@ -267,7 +267,7 @@ public: class TModel3d { - friend opengl33_renderer; + friend opengl46_renderer; public: // submodels which scenery instances of the model refer to by name diff --git a/rendering/opengl33geometrybank.cpp b/rendering/opengl46/opengl46geometrybank.cpp similarity index 95% rename from rendering/opengl33geometrybank.cpp rename to rendering/opengl46/opengl46geometrybank.cpp index f2843fea..63ed4751 100644 --- a/rendering/opengl33geometrybank.cpp +++ b/rendering/opengl46/opengl46geometrybank.cpp @@ -8,7 +8,7 @@ http://mozilla.org/MPL/2.0/. */ #include "stdafx.h" -#include "rendering/opengl33geometrybank.h" +#include "rendering/opengl46/opengl46geometrybank.h" #include "utilities/Logs.h" @@ -18,7 +18,7 @@ namespace gfx { // create() subclass details void -opengl33_vaogeometrybank::create_( gfx::geometry_handle const &Geometry ) { +opengl46_vaogeometrybank::create_( gfx::geometry_handle const &Geometry ) { // adding a chunk means we'll be (re)building the buffer, which will fill the chunk records, amongst other things. // thus we don't need to initialize the values here m_chunkrecords.emplace_back( chunk_record() ); @@ -28,7 +28,7 @@ opengl33_vaogeometrybank::create_( gfx::geometry_handle const &Geometry ) { // replace() subclass details void -opengl33_vaogeometrybank::replace_( gfx::geometry_handle const &Geometry ) { +opengl46_vaogeometrybank::replace_( gfx::geometry_handle const &Geometry ) { auto &chunkrecord = m_chunkrecords[ Geometry.chunk - 1 ]; chunkrecord.is_good = false; @@ -41,7 +41,7 @@ opengl33_vaogeometrybank::replace_( gfx::geometry_handle const &Geometry ) { } } -void opengl33_vaogeometrybank::setup_buffer() +void opengl46_vaogeometrybank::setup_buffer() { if( m_vertexbuffer ) { return; } // if there's no buffer, we'll have to make one @@ -106,7 +106,7 @@ void opengl33_vaogeometrybank::setup_buffer() } void -opengl33_vaogeometrybank::setup_attrib(size_t offset) +opengl46_vaogeometrybank::setup_attrib(size_t offset) { m_vao->setup_attrib( *m_vertexbuffer, 0, 3, GL_FLOAT, sizeof( basic_vertex ), offsetof(basic_vertex, position) + offset * sizeof( basic_vertex ) ); // NOTE: normal and color streams share the data @@ -115,7 +115,7 @@ opengl33_vaogeometrybank::setup_attrib(size_t offset) m_vao->setup_attrib( *m_vertexbuffer, 3, 4, GL_FLOAT, sizeof( basic_vertex ), offsetof(basic_vertex, tangent) + offset * sizeof( basic_vertex ) ); } -void opengl33_vaogeometrybank::setup_userdata(size_t offset) { +void opengl46_vaogeometrybank::setup_userdata(size_t offset) { const size_t offset_evaluated = m_vertex_count * sizeof(basic_vertex) + offset * sizeof( vertex_userdata ); m_vao->setup_attrib( *m_vertexbuffer, 4, 4, GL_FLOAT, sizeof( vertex_userdata ), offsetof(vertex_userdata, data) + offset_evaluated );} @@ -123,7 +123,7 @@ void opengl33_vaogeometrybank::setup_userdata(size_t offset) { // NOTE: units and stream parameters are unused, but they're part of (legacy) interface // TBD: specialized bank/manager pair without the cruft? std::size_t -opengl33_vaogeometrybank::draw_( gfx::geometry_handle const &Geometry, gfx::stream_units const &Units, unsigned int const Streams ) +opengl46_vaogeometrybank::draw_( gfx::geometry_handle const &Geometry, gfx::stream_units const &Units, unsigned int const Streams ) { setup_buffer(); @@ -183,7 +183,7 @@ opengl33_vaogeometrybank::draw_( gfx::geometry_handle const &Geometry, gfx::stre // draw_instanced() subclass details — single GL instanced draw for InstanceCount instances. // The vertex shader reads per-instance modelview from instance_ubo[gl_InstanceID]. std::size_t -opengl33_vaogeometrybank::draw_instanced_( gfx::geometry_handle const &Geometry, gfx::stream_units const &Units, std::size_t const InstanceCount, unsigned int const Streams ) +opengl46_vaogeometrybank::draw_instanced_( gfx::geometry_handle const &Geometry, gfx::stream_units const &Units, std::size_t const InstanceCount, unsigned int const Streams ) { setup_buffer(); @@ -246,7 +246,7 @@ opengl33_vaogeometrybank::draw_instanced_( gfx::geometry_handle const &Geometry, // draw_batch() subclass details — neighbouring non-indexed chunks of the same type are sent with a single GL call. // The chunks are drawn in the supplied order, same as with a draw_() call for each of them. std::size_t -opengl33_vaogeometrybank::draw_batch_( gfx::geometry_handle const *First, gfx::geometry_handle const *Last, gfx::stream_units const &Units, unsigned int const Streams ) +opengl46_vaogeometrybank::draw_batch_( gfx::geometry_handle const *First, gfx::geometry_handle const *Last, gfx::stream_units const &Units, unsigned int const Streams ) { std::size_t count { 0 }; @@ -305,13 +305,13 @@ opengl33_vaogeometrybank::draw_batch_( gfx::geometry_handle const *First, gfx::g // release () subclass details void -opengl33_vaogeometrybank::release_() { +opengl46_vaogeometrybank::release_() { delete_buffer(); } void -opengl33_vaogeometrybank::delete_buffer() { +opengl46_vaogeometrybank::delete_buffer() { m_vao.reset(); m_vertexbuffer.reset(); diff --git a/rendering/opengl33geometrybank.h b/rendering/opengl46/opengl46geometrybank.h similarity index 95% rename from rendering/opengl33geometrybank.h rename to rendering/opengl46/opengl46geometrybank.h index 79526f10..553dfb2c 100644 --- a/rendering/opengl33geometrybank.h +++ b/rendering/opengl46/opengl46geometrybank.h @@ -17,13 +17,13 @@ namespace gfx { // opengl vao/vbo-based variant of the geometry bank -class opengl33_vaogeometrybank : public geometry_bank { +class opengl46_vaogeometrybank : public geometry_bank { public: // constructors: - opengl33_vaogeometrybank() = default; + opengl46_vaogeometrybank() = default; // destructor - ~opengl33_vaogeometrybank() { + ~opengl46_vaogeometrybank() { delete_buffer(); } // methods: static diff --git a/rendering/opengl33light.cpp b/rendering/opengl46/opengl46light.cpp similarity index 65% rename from rendering/opengl33light.cpp rename to rendering/opengl46/opengl46light.cpp index dddb3236..f083d322 100644 --- a/rendering/opengl33light.cpp +++ b/rendering/opengl46/opengl46light.cpp @@ -9,14 +9,14 @@ http://mozilla.org/MPL/2.0/. #include "stdafx.h" -#include "rendering/opengl33light.h" +#include "rendering/opengl46/opengl46light.h" -void opengl33_light::apply_intensity(float const Factor) { +void opengl46_light::apply_intensity(float const Factor) { factor = Factor; } -void opengl33_light::apply_angle() const { /* nothing to do */ } +void opengl46_light::apply_angle() const { /* nothing to do */ } //--------------------------------------------------------------------------- diff --git a/rendering/opengl33light.h b/rendering/opengl46/opengl46light.h similarity index 83% rename from rendering/opengl33light.h rename to rendering/opengl46/opengl46light.h index b36bad97..0830d069 100644 --- a/rendering/opengl33light.h +++ b/rendering/opengl46/opengl46light.h @@ -11,7 +11,7 @@ http://mozilla.org/MPL/2.0/. #include "rendering/light.h" -struct opengl33_light : public basic_light { +struct opengl46_light : public basic_light { GLuint id{(GLuint)-1}; @@ -20,7 +20,7 @@ struct opengl33_light : public basic_light { void apply_intensity(float const Factor = 1.0f); void apply_angle() const; - opengl33_light &operator=(basic_light const &Right) { + opengl46_light &operator=(basic_light const &Right) { basic_light::operator=(Right); return *this; } }; diff --git a/rendering/opengl33particles.cpp b/rendering/opengl46/opengl46particles.cpp similarity index 97% rename from rendering/opengl33particles.cpp rename to rendering/opengl46/opengl46particles.cpp index 8ff82b95..1de26ff2 100644 --- a/rendering/opengl33particles.cpp +++ b/rendering/opengl46/opengl46particles.cpp @@ -8,7 +8,7 @@ http://mozilla.org/MPL/2.0/. */ #include "stdafx.h" -#include "rendering/opengl33particles.h" +#include "rendering/opengl46/opengl46particles.h" #include "rendering/particles.h" #include "rendering/openglcamera.h" @@ -26,7 +26,7 @@ std::vector> const billboard_vertices { }; void -opengl33_particles::update( opengl_camera const &Camera ) { +opengl46_particles::update( opengl_camera const &Camera ) { if (!Global.Smoke) return; @@ -100,7 +100,7 @@ opengl33_particles::update( opengl_camera const &Camera ) { } std::size_t -opengl33_particles::render() { +opengl46_particles::render() { if( false == Global.Smoke ) { return 0; } if( m_buffercapacity == 0 ) { return 0; } diff --git a/rendering/opengl33particles.h b/rendering/opengl46/opengl46particles.h similarity index 95% rename from rendering/opengl33particles.h rename to rendering/opengl46/opengl46particles.h index 0d51a8ec..34f61838 100644 --- a/rendering/opengl33particles.h +++ b/rendering/opengl46/opengl46particles.h @@ -16,10 +16,10 @@ http://mozilla.org/MPL/2.0/. class opengl_camera; // particle data visualizer -class opengl33_particles { +class opengl46_particles { public: // constructors - opengl33_particles() = default; + opengl46_particles() = default; // methods void diff --git a/rendering/opengl33precipitation.cpp b/rendering/opengl46/opengl46precipitation.cpp similarity index 95% rename from rendering/opengl33precipitation.cpp rename to rendering/opengl46/opengl46precipitation.cpp index 308248b7..efefcf10 100644 --- a/rendering/opengl33precipitation.cpp +++ b/rendering/opengl46/opengl46precipitation.cpp @@ -8,18 +8,18 @@ http://mozilla.org/MPL/2.0/. */ #include "stdafx.h" -#include "rendering/opengl33precipitation.h" +#include "rendering/opengl46/opengl46precipitation.h" #include "utilities/Globals.h" #include "rendering/renderer.h" #include "simulation/simulationenvironment.h" -opengl33_precipitation::~opengl33_precipitation() { +opengl46_precipitation::~opengl46_precipitation() { // TODO: release allocated resources } void -opengl33_precipitation::create( int const Tesselation ) { +opengl46_precipitation::create( int const Tesselation ) { m_vertices.clear(); m_uvs.clear(); @@ -86,7 +86,7 @@ opengl33_precipitation::create( int const Tesselation ) { } void -opengl33_precipitation::update() { +opengl46_precipitation::update() { if (!m_shader) { @@ -143,7 +143,7 @@ opengl33_precipitation::update() { } void -opengl33_precipitation::render() { +opengl46_precipitation::render() { if( !m_shader ) { return; } if( !m_vao ) { return; } diff --git a/rendering/opengl33precipitation.h b/rendering/opengl46/opengl46precipitation.h similarity index 90% rename from rendering/opengl33precipitation.h rename to rendering/opengl46/opengl46precipitation.h index 9aab5ec5..9dacb9d2 100644 --- a/rendering/opengl33precipitation.h +++ b/rendering/opengl46/opengl46precipitation.h @@ -13,13 +13,13 @@ http://mozilla.org/MPL/2.0/. #include "gl/vao.h" #include "gl/shader.h" -class opengl33_precipitation { +class opengl46_precipitation { public: // constructors - opengl33_precipitation() = default; + opengl46_precipitation() = default; // destructor - ~opengl33_precipitation(); + ~opengl46_precipitation(); // methods void update(); diff --git a/rendering/opengl33renderer.cpp b/rendering/opengl46/opengl46renderer.cpp similarity index 96% rename from rendering/opengl33renderer.cpp rename to rendering/opengl46/opengl46renderer.cpp index fbaad923..f7f29319 100644 --- a/rendering/opengl33renderer.cpp +++ b/rendering/opengl46/opengl46renderer.cpp @@ -8,7 +8,7 @@ http://mozilla.org/MPL/2.0/. */ #include "stdafx.h" -#include "rendering/opengl33renderer.h" +#include "rendering/opengl46/opengl46renderer.h" #include "utilities/color.h" #include "utilities/Globals.h" #include "utilities/Timer.h" @@ -19,7 +19,7 @@ http://mozilla.org/MPL/2.0/. #include "simulation/simulationtime.h" #include "application/application.h" #include "model/AnimModel.h" -#include "rendering/opengl33geometrybank.h" +#include "rendering/opengl46/opengl46geometrybank.h" #include "rendering/screenshot.h" #include "rendering/editoroverlay.h" #include @@ -94,7 +94,7 @@ ErrorCallback( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei l + message ); } -bool opengl33_renderer::Init(GLFWwindow *Window) +bool opengl46_renderer::Init(GLFWwindow *Window) { if (Global.gfx_gldebug && GLAD_GL_KHR_debug) { glEnable( GL_DEBUG_OUTPUT ); @@ -125,12 +125,12 @@ bool opengl33_renderer::Init(GLFWwindow *Window) Global.DayLight.diffuse[1] = 0.9490196f; // 242 / 255 Global.DayLight.diffuse[2] = 0.9058824f; // 231 / 255 Global.DayLight.is_directional = true; - m_sunlight.id = opengl33_renderer::sunlight; + m_sunlight.id = opengl46_renderer::sunlight; // create dynamic light pool for (int idx = 0; idx < Global.DynamicLightCount; ++idx) { - opengl33_light light; + opengl46_light light; light.id = 1 + idx; light.is_directional = false; @@ -380,12 +380,12 @@ bool opengl33_renderer::Init(GLFWwindow *Window) return true; } -void opengl33_renderer::Shutdown() +void opengl46_renderer::Shutdown() { vr.reset(); } -bool opengl33_renderer::AddViewport(const global_settings::extraviewport_config &conf) +bool opengl46_renderer::AddViewport(const global_settings::extraviewport_config &conf) { viewport_config *vp; @@ -410,7 +410,7 @@ bool opengl33_renderer::AddViewport(const global_settings::extraviewport_config return ret; } -bool opengl33_renderer::init_viewport(viewport_config &vp) +bool opengl46_renderer::init_viewport(viewport_config &vp) { if (vp.initialized) return true; @@ -552,7 +552,7 @@ bool opengl33_renderer::init_viewport(viewport_config &vp) return true; } -std::unique_ptr opengl33_renderer::make_shader(std::string v, std::string f) +std::unique_ptr opengl46_renderer::make_shader(std::string v, std::string f) { gl::shader vert(v); gl::shader frag(f); @@ -560,7 +560,7 @@ std::unique_ptr opengl33_renderer::make_shader(std::string v, std:: return std::unique_ptr(prog); } -bool opengl33_renderer::Render() +bool opengl46_renderer::Render() { Timer::subsystem.gfx_total.start(); @@ -620,12 +620,12 @@ bool opengl33_renderer::Render() Timer::subsystem.gfx_total.stop(); // swapbuffers() could unbind current buffers so we prepare for it on our end - gfx::opengl33_vaogeometrybank::reset(); + gfx::opengl46_vaogeometrybank::reset(); return true; // for now always succeed } -void opengl33_renderer::SwapBuffers() +void opengl46_renderer::SwapBuffers() { Timer::subsystem.gfx_swap.start(); @@ -692,7 +692,7 @@ void opengl33_renderer::SwapBuffers() + "particles: " + to_string( m_colorpass.draw_stats.particles, 7 ); } -void opengl33_renderer::draw_debug_ui() +void opengl46_renderer::draw_debug_ui() { if (!debug_ui_active) return; @@ -722,7 +722,7 @@ void opengl33_renderer::draw_debug_ui() } // runs jobs needed to generate graphics for specified render pass -void opengl33_renderer::Render_pass(viewport_config &vp, rendermode const Mode) +void opengl46_renderer::Render_pass(viewport_config &vp, rendermode const Mode) { setup_pass(vp, m_renderpass, Mode); switch (m_renderpass.draw_mode) @@ -1252,7 +1252,7 @@ if (!Global.gfx_skippipeline) } -bool opengl33_renderer::Render_interior( bool const Alpha ) { +bool opengl46_renderer::Render_interior( bool const Alpha ) { // TODO: early frustum based cull, camera might be pointing elsewhere std::vector< std::pair > dynamics; auto *dynamic { simulation::Train->Dynamic() }; @@ -1286,7 +1286,7 @@ bool opengl33_renderer::Render_interior( bool const Alpha ) { return true; } -bool opengl33_renderer::Render_lowpoly( TDynamicObject *Dynamic, float const Squaredistance, bool const Setup, bool const Alpha ) { +bool opengl46_renderer::Render_lowpoly( TDynamicObject *Dynamic, float const Squaredistance, bool const Setup, bool const Alpha ) { if( Dynamic->mdLowPolyInt == nullptr ) { return false; } @@ -1362,7 +1362,7 @@ bool opengl33_renderer::Render_lowpoly( TDynamicObject *Dynamic, float const Squ return true; } -bool opengl33_renderer::Render_coupler_adapter( TDynamicObject *Dynamic, float const Squaredistance, int const End, bool const Alpha ) { +bool opengl46_renderer::Render_coupler_adapter( TDynamicObject *Dynamic, float const Squaredistance, int const End, bool const Alpha ) { if( Dynamic->m_coupleradapters[ End ] == nullptr ) { return false; } @@ -1387,7 +1387,7 @@ bool opengl33_renderer::Render_coupler_adapter( TDynamicObject *Dynamic, float c } // creates dynamic environment cubemap -bool opengl33_renderer::Render_reflections(viewport_config &vp) +bool opengl46_renderer::Render_reflections(viewport_config &vp) { if( Global.reflectiontune.update_interval == 0 ) { return false; } @@ -1428,7 +1428,7 @@ bool opengl33_renderer::Render_reflections(viewport_config &vp) // based on // https://csc.lsu.edu/~kooima/articles/genperspective/index.html -glm::mat4 opengl33_renderer::perspective_projection(const viewport_proj_config &c, +glm::mat4 opengl46_renderer::perspective_projection(const viewport_proj_config &c, float n, float f, glm::mat4 &frustum) { glm::vec3 vr, vu, vn; @@ -1483,7 +1483,7 @@ glm::mat4 opengl33_renderer::perspective_projection(const viewport_proj_config & return glm::translate(R * M, -c.pe); } -glm::mat4 opengl33_renderer::perspective_projection_raw(float fovy, float aspect, float znear, float zfar) +glm::mat4 opengl46_renderer::perspective_projection_raw(float fovy, float aspect, float znear, float zfar) { if (GLAD_GL_ARB_clip_control || GLAD_GL_EXT_clip_control) { @@ -1509,7 +1509,7 @@ glm::mat4 opengl33_renderer::perspective_projection_raw(float fovy, float aspect glm::perspective(fovy, aspect, znear, zfar); } -glm::mat4 opengl33_renderer::ortho_projection(float l, float r, float b, float t, float znear, float zfar) +glm::mat4 opengl46_renderer::ortho_projection(float l, float r, float b, float t, float znear, float zfar) { glm::mat4 proj = glm::ortho(l, r, b, t, znear, zfar); if (GLAD_GL_ARB_clip_control || GLAD_GL_EXT_clip_control) @@ -1533,14 +1533,14 @@ glm::mat4 opengl33_renderer::ortho_projection(float l, float r, float b, float t proj; } -glm::mat4 opengl33_renderer::ortho_frustumtest_projection(float l, float r, float b, float t, float znear, float zfar) +glm::mat4 opengl46_renderer::ortho_frustumtest_projection(float l, float r, float b, float t, float znear, float zfar) { // for frustum calculation, use standard opengl matrix return glm::ortho(l, r, b, t, znear, zfar); } // the main viewport of the editor in the orthographic view replaces the perspective projection -void opengl33_renderer::editor_ortho_projection(viewport_config const &Viewport, float const Zfar, glm::mat4 &Projection, glm::mat4 &Frustum) +void opengl46_renderer::editor_ortho_projection(viewport_config const &Viewport, float const Zfar, glm::mat4 &Projection, glm::mat4 &Frustum) { if (false == (EditorModeFlag && Global.EditorOrtho && Viewport.main)) return; @@ -1550,7 +1550,7 @@ void opengl33_renderer::editor_ortho_projection(viewport_config const &Viewport, Frustum = ortho_frustumtest_projection(-width, width, -height, height, -Zfar, Zfar); } -void opengl33_renderer::setup_pass(viewport_config &Viewport, renderpass_config &Config, rendermode const Mode, +void opengl46_renderer::setup_pass(viewport_config &Viewport, renderpass_config &Config, rendermode const Mode, float const Znear, float const Zfar, bool const Ignoredebug) { Config.draw_mode = Mode; @@ -1762,7 +1762,7 @@ void opengl33_renderer::setup_pass(viewport_config &Viewport, renderpass_config camera.update_frustum(frustumtest_proj); } -void opengl33_renderer::setup_matrices() +void opengl46_renderer::setup_matrices() { OpenGLMatrices.mode(GL_PROJECTION); OpenGLMatrices.load_matrix(m_renderpass.pass_camera.projection()); @@ -1771,7 +1771,7 @@ void opengl33_renderer::setup_matrices() OpenGLMatrices.load_matrix(glm::mat4{glm::mat3{m_renderpass.pass_camera.modelview()}}); } -void opengl33_renderer::setup_drawing(bool const Alpha) +void opengl46_renderer::setup_drawing(bool const Alpha) { if (Alpha) { @@ -1812,13 +1812,13 @@ void opengl33_renderer::setup_drawing(bool const Alpha) } } -void opengl33_renderer::setup_shadow_unbind_map() +void opengl46_renderer::setup_shadow_unbind_map() { opengl_texture::unbind( gl::SHADOW_TEX ); } // binds shadow map and updates shadow map uniform data -void opengl33_renderer::setup_shadow_bind_map() +void opengl46_renderer::setup_shadow_bind_map() { if( false == Global.gfx_shadowmap_enabled ) { return; } @@ -1862,12 +1862,12 @@ void opengl33_renderer::setup_shadow_bind_map() scene_ubo->update(scene_ubs); } -void opengl33_renderer::setup_shadow_color( glm::vec4 const &Shadowcolor ) { +void opengl46_renderer::setup_shadow_color( glm::vec4 const &Shadowcolor ) { model_ubs.shadow_tone = glm::pow( Shadowcolor.x, 2.2f ); } -void opengl33_renderer::setup_env_map(gl::cubemap *tex) +void opengl46_renderer::setup_env_map(gl::cubemap *tex) { if (tex) { @@ -1883,7 +1883,7 @@ void opengl33_renderer::setup_env_map(gl::cubemap *tex) opengl_texture::reset_unit_cache(); } -void opengl33_renderer::setup_environment_light(TEnvironmentType const Environment) +void opengl46_renderer::setup_environment_light(TEnvironmentType const Environment) { switch (Environment) @@ -1913,7 +1913,7 @@ void opengl33_renderer::setup_environment_light(TEnvironmentType const Environme } } -void opengl33_renderer::setup_sunlight_intensity( float const Factor ) { +void opengl46_renderer::setup_sunlight_intensity( float const Factor ) { m_sunlight.apply_intensity( Factor ); light_ubs.lights[ 0 ].intensity = m_sunlight.factor * (1.0f - Global.Overcast * 0.33f); @@ -1921,7 +1921,7 @@ void opengl33_renderer::setup_sunlight_intensity( float const Factor ) { light_ubo->update( light_ubs ); } -bool opengl33_renderer::Render(world_environment *Environment) +bool opengl46_renderer::Render(world_environment *Environment) { m_shadowcolor = colors::white; // prevent shadow from affecting sky setup_shadow_color( m_shadowcolor ); @@ -1946,7 +1946,7 @@ bool opengl33_renderer::Render(world_environment *Environment) m_skydomerenderer.update(); m_skydomerenderer.render(); // skydome uses a custom vbo which could potentially confuse the main geometry system. hardly elegant but, eh - gfx::opengl33_vaogeometrybank::reset(); + gfx::opengl46_vaogeometrybank::reset(); } glPopMatrix(); @@ -2120,20 +2120,20 @@ bool opengl33_renderer::Render(world_environment *Environment) // geometry methods // creates a new geometry bank. returns: handle to the bank or NULL -gfx::geometrybank_handle opengl33_renderer::Create_Bank() +gfx::geometrybank_handle opengl46_renderer::Create_Bank() { - return m_geometry.register_bank(std::make_unique()); + return m_geometry.register_bank(std::make_unique()); } // creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL -gfx::geometry_handle opengl33_renderer::Insert(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) +gfx::geometry_handle opengl46_renderer::Insert(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) { // NOTE: we expect indexed geometry to come with calculated tangents return m_geometry.create_chunk( Indices, Vertices, Userdata, Geometry, Type ); } // creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL -gfx::geometry_handle opengl33_renderer::Insert(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) +gfx::geometry_handle opengl46_renderer::Insert(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type) { gfx::calculate_tangents(Vertices, gfx::index_array(), Type); @@ -2141,7 +2141,7 @@ gfx::geometry_handle opengl33_renderer::Insert(gfx::vertex_array &Vertices, gfx: } // replaces data of specified chunk with the supplied vertex data, starting from specified offset -bool opengl33_renderer::Replace(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type, const std::size_t Offset) +bool opengl46_renderer::Replace(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type, const std::size_t Offset) { gfx::calculate_tangents(Vertices, gfx::index_array(), Type); @@ -2149,7 +2149,7 @@ bool opengl33_renderer::Replace(gfx::vertex_array &Vertices, gfx::userdata_array } // adds supplied vertex data at the end of specified chunk -bool opengl33_renderer::Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type) +bool opengl46_renderer::Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type) { gfx::calculate_tangents(Vertices, gfx::index_array(), Type); @@ -2157,30 +2157,30 @@ bool opengl33_renderer::Append(gfx::vertex_array &Vertices, gfx::userdata_array } // provides direct access to index data of specfied chunk -gfx::index_array const & opengl33_renderer::Indices(gfx::geometry_handle const &Geometry) const +gfx::index_array const & opengl46_renderer::Indices(gfx::geometry_handle const &Geometry) const { return m_geometry.indices(Geometry); } // provides direct access to vertex data of specfied chunk -gfx::vertex_array const &opengl33_renderer::Vertices(gfx::geometry_handle const &Geometry) const +gfx::vertex_array const &opengl46_renderer::Vertices(gfx::geometry_handle const &Geometry) const { return m_geometry.vertices(Geometry); } -gfx::userdata_array const &opengl33_renderer::UserData(const gfx::geometry_handle &Geometry) const +gfx::userdata_array const &opengl46_renderer::UserData(const gfx::geometry_handle &Geometry) const { return m_geometry.userdata(Geometry); } // material methods -material_handle opengl33_renderer::Fetch_Material(std::string const &Filename, bool const Loadnow) +material_handle opengl46_renderer::Fetch_Material(std::string const &Filename, bool const Loadnow) { return m_materials.create(Filename, Loadnow); } -std::shared_ptr opengl33_renderer::Fetch_Shader(const std::string &name) +std::shared_ptr opengl46_renderer::Fetch_Shader(const std::string &name) { auto it = m_shaders.find(name); if (it == m_shaders.end()) @@ -2193,7 +2193,7 @@ std::shared_ptr opengl33_renderer::Fetch_Shader(const std::string & return m_shaders[name]; } -void opengl33_renderer::Bind_Material( material_handle const Material, TSubModel const *sm, lighting_data const *lighting ) +void opengl46_renderer::Bind_Material( material_handle const Material, TSubModel const *sm, lighting_data const *lighting ) { if (Material != null_handle) { @@ -2349,7 +2349,7 @@ void opengl33_renderer::Bind_Material( material_handle const Material, TSubModel Bind_Material(m_invalid_material); } -void opengl33_renderer::Bind_Material_Shadow(material_handle const Material) +void opengl46_renderer::Bind_Material_Shadow(material_handle const Material) { if (Material != null_handle) { @@ -2369,12 +2369,12 @@ void opengl33_renderer::Bind_Material_Shadow(material_handle const Material) } } -IMaterial const *opengl33_renderer::Material(material_handle const Material) const +IMaterial const *opengl46_renderer::Material(material_handle const Material) const { return &m_materials.material(Material); } -material_handle opengl33_renderer::Terrain_Material(material_handle const Reuse, std::vector const &Layers, int const Samples, std::uint8_t const *Weights, glm::vec3 const &Placement) +material_handle opengl46_renderer::Terrain_Material(material_handle const Reuse, std::vector const &Layers, int const Samples, std::uint8_t const *Weights, glm::vec3 const &Placement) { auto const material{m_terrainmaterials.make(Reuse, Layers, Samples, Weights, Placement)}; if (material != null_handle) @@ -2383,54 +2383,54 @@ material_handle opengl33_renderer::Terrain_Material(material_handle const Reuse, return gfx_renderer::Terrain_Material(Reuse, Layers, Samples, Weights, Placement); } -void opengl33_renderer::Terrain_Release(material_handle const Material) +void opengl46_renderer::Terrain_Release(material_handle const Material) { m_terrainmaterials.release(Material); } -opengl_material &opengl33_renderer::Material(material_handle const Material) +opengl_material &opengl46_renderer::Material(material_handle const Material) { return m_materials.material(Material); } -opengl_material const & opengl33_renderer::Material( TSubModel const * Submodel ) const { +opengl_material const & opengl46_renderer::Material( TSubModel const * Submodel ) const { return m_materials.material( submodel_material( Submodel ) ); } -texture_handle opengl33_renderer::Fetch_Texture(std::string const &Filename, bool const Loadnow, GLint format_hint) +texture_handle opengl46_renderer::Fetch_Texture(std::string const &Filename, bool const Loadnow, GLint format_hint) { return m_textures.create(Filename, Loadnow, format_hint); } -void opengl33_renderer::Bind_Texture( texture_handle const Texture ) +void opengl46_renderer::Bind_Texture( texture_handle const Texture ) { return Bind_Texture( 0, Texture ); } -void opengl33_renderer::Bind_Texture(std::size_t const Unit, texture_handle const Texture) +void opengl46_renderer::Bind_Texture(std::size_t const Unit, texture_handle const Texture) { m_textures.bind(Unit, Texture); } -ITexture &opengl33_renderer::Texture(texture_handle const Texture) +ITexture &opengl46_renderer::Texture(texture_handle const Texture) { return m_textures.texture(Texture); } -ITexture const &opengl33_renderer::Texture(texture_handle const Texture) const +ITexture const &opengl46_renderer::Texture(texture_handle const Texture) const { return m_textures.texture(Texture); } -void opengl33_renderer::Update_AnimModel(TAnimModel *model) +void opengl46_renderer::Update_AnimModel(TAnimModel *model) { model->RaAnimate(m_framestamp); } -void opengl33_renderer::Render(scene::basic_region *Region) +void opengl46_renderer::Render(scene::basic_region *Region) { m_sectionqueue.clear(); @@ -2526,7 +2526,7 @@ void opengl33_renderer::Render(scene::basic_region *Region) } } -void opengl33_renderer::Render(section_sequence::iterator First, section_sequence::iterator Last) +void opengl46_renderer::Render(section_sequence::iterator First, section_sequence::iterator Last) { switch (m_renderpass.draw_mode) @@ -2637,7 +2637,7 @@ void opengl33_renderer::Render(section_sequence::iterator First, section_sequenc } } -void opengl33_renderer::Render(cell_sequence::iterator First, cell_sequence::iterator Last) +void opengl46_renderer::Render(cell_sequence::iterator First, cell_sequence::iterator Last) { // cache initial iterator for the second sweep @@ -2881,7 +2881,7 @@ void opengl33_renderer::Render(cell_sequence::iterator First, cell_sequence::ite } } -void opengl33_renderer::Draw_Geometry(std::vector::iterator begin, std::vector::iterator end) +void opengl46_renderer::Draw_Geometry(std::vector::iterator begin, std::vector::iterator end) { if (begin == end) { @@ -2892,12 +2892,12 @@ void opengl33_renderer::Draw_Geometry(std::vector::ite m_geometry.draw_batch(first, first + std::distance(begin, end)); } -void opengl33_renderer::Draw_Geometry(const gfx::geometrybank_handle &handle) +void opengl46_renderer::Draw_Geometry(const gfx::geometrybank_handle &handle) { m_geometry.draw(handle); } -void opengl33_renderer::draw(const gfx::geometry_handle &handle) +void opengl46_renderer::draw(const gfx::geometry_handle &handle) { model_ubs.set_modelview(OpenGLMatrices.data(GL_MODELVIEW)); model_ubo->update(model_ubs); @@ -2912,7 +2912,7 @@ void opengl33_renderer::draw(const gfx::geometry_handle &handle) } } -void opengl33_renderer::draw(std::vector::iterator it, std::vector::iterator end) +void opengl46_renderer::draw(std::vector::iterator it, std::vector::iterator end) { model_ubs.set_modelview(OpenGLMatrices.data(GL_MODELVIEW)); model_ubo->update(model_ubs); @@ -2920,7 +2920,7 @@ void opengl33_renderer::draw(std::vector::iterator it, Draw_Geometry(it, end); } -void opengl33_renderer::Render(scene::shape_node const &Shape, bool const Ignorerange) +void opengl46_renderer::Render(scene::shape_node const &Shape, bool const Ignorerange) { auto const &data{Shape.data()}; @@ -2988,7 +2988,7 @@ void opengl33_renderer::Render(scene::shape_node const &Shape, bool const Ignore ++m_renderpass.draw_stats.drawcalls; } -void opengl33_renderer::Render(TAnimModel *Instance) +void opengl46_renderer::Render(TAnimModel *Instance) { if (false == Instance->m_visible) { return; } @@ -3091,7 +3091,7 @@ void opengl33_renderer::Render(TAnimModel *Instance) // Render_Instanced() culls each instance it's given. the tests it makes are repeated here on the copies of instance // bounds kept by the buckets, with some slack for the single precision of the copies, and the instances which fail are // left out: the instances themselves are fetched only when there's a chance for them to be drawn -void opengl33_renderer::Queue_Instances( scene::basic_cell const *Cell ) +void opengl46_renderer::Queue_Instances( scene::basic_cell const *Cell ) { // the editor moves and resizes the instances in place, the copies can't be relied on while it's active auto const usebounds { false == EditorModeFlag }; @@ -3139,7 +3139,7 @@ void opengl33_renderer::Queue_Instances( scene::basic_cell const *Cell ) } // makes the copies of the bounds of the instances held by a bucket of a scene cell -void opengl33_renderer::Update_Instance_Bounds( TModel3d const *Model, scene::basic_cell::instance_bucket const &Bucket ) +void opengl46_renderer::Update_Instance_Bounds( TModel3d const *Model, scene::basic_cell::instance_bucket const &Bucket ) { // a submodel is drawn only closer than its fSquareMaxDist, see Render( TSubModel * ). past the largest of these // there's nothing of the model left to draw, which makes it another limit of the range of its instances @@ -3178,7 +3178,7 @@ void opengl33_renderer::Update_Instance_Bounds( TModel3d const *Model, scene::ba // (accumulated by the matrix stack starting from identity, NOT the camera/instance frame). // // Batch size is capped at MAX_INSTANCES_PER_BATCH (256). Larger groups are split. -void opengl33_renderer::Render_Instanced( TModel3d *Model, std::vector const &Instances ) +void opengl46_renderer::Render_Instanced( TModel3d *Model, std::vector const &Instances ) { if( Model == nullptr ) { return; } if( Instances.empty() ) { return; } @@ -3381,7 +3381,7 @@ void opengl33_renderer::Render_Instanced( TModel3d *Model, std::vector const &opengl33_renderer::Model_Textures(TModel3d *Model) +std::vector const &opengl46_renderer::Model_Textures(TModel3d *Model) { auto const lookup{m_modeltextures.find(Model)}; if (lookup != m_modeltextures.end()) @@ -3493,7 +3493,7 @@ std::vector const &opengl33_renderer::Model_Textures(TModel3d *M return textures; } -void opengl33_renderer::Render_Sleepers( TTrack *Track ) +void opengl46_renderer::Render_Sleepers( TTrack *Track ) { if( Track == nullptr ) { return; } if( false == Track->m_sleeper_enabled ) { return; } @@ -3677,7 +3677,7 @@ void opengl33_renderer::Render_Sleepers( TTrack *Track ) m_renderpass.draw_stats.models += static_cast( total ); } -bool opengl33_renderer::Render(TDynamicObject *Dynamic) +bool opengl46_renderer::Render(TDynamicObject *Dynamic) { glDebug("Render TDynamicObject"); @@ -3853,7 +3853,7 @@ bool opengl33_renderer::Render(TDynamicObject *Dynamic) } // rendering kabiny gdy jest oddzielnym modelem i ma byc wyswietlana -bool opengl33_renderer::Render_cab(TDynamicObject const *Dynamic, float const Lightlevel, bool const Alpha) +bool opengl46_renderer::Render_cab(TDynamicObject const *Dynamic, float const Lightlevel, bool const Alpha) { if (Dynamic == nullptr) @@ -3947,7 +3947,7 @@ bool opengl33_renderer::Render_cab(TDynamicObject const *Dynamic, float const Li return true; } -bool opengl33_renderer::Render(TModel3d *Model, material_data const *Material, float const Squaredistance) +bool opengl46_renderer::Render(TModel3d *Model, material_data const *Material, float const Squaredistance) { auto alpha = (Material != nullptr ? Material->textures_alpha : 0x30300030); @@ -3973,7 +3973,7 @@ bool opengl33_renderer::Render(TModel3d *Model, material_data const *Material, f return true; } -bool opengl33_renderer::Render(TModel3d *Model, material_data const *Material, float const Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle) +bool opengl46_renderer::Render(TModel3d *Model, material_data const *Material, float const Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle) { ::glPushMatrix(); ::glTranslated(Position.x, Position.y, Position.z); @@ -3991,7 +3991,7 @@ bool opengl33_renderer::Render(TModel3d *Model, material_data const *Material, f return result; } -void opengl33_renderer::Render(TSubModel *Submodel) +void opengl46_renderer::Render(TSubModel *Submodel) { glDebug("Render TSubModel"); @@ -4160,7 +4160,7 @@ void opengl33_renderer::Render(TSubModel *Submodel) Render(Submodel->Next); // dalsze rekurencyjnie } -void opengl33_renderer::Render(TTrack *Track) +void opengl46_renderer::Render(TTrack *Track) { if ((Track->m_material1 == 0) && (Track->m_material2 == 0) && (Track->eType != tt_Switch || Track->SwitchExtension->m_material3 == 0)) { @@ -4196,7 +4196,7 @@ void opengl33_renderer::Render(TTrack *Track) } // experimental, does track rendering in two passes, to take advantage of reduced texture switching -void opengl33_renderer::Render(scene::basic_cell::path_sequence::const_iterator First, scene::basic_cell::path_sequence::const_iterator Last) +void opengl46_renderer::Render(scene::basic_cell::path_sequence::const_iterator First, scene::basic_cell::path_sequence::const_iterator Last) { // setup @@ -4465,7 +4465,7 @@ void opengl33_renderer::Render(scene::basic_cell::path_sequence::const_iterator } } -void opengl33_renderer::Render(TMemCell *Memcell) +void opengl46_renderer::Render(TMemCell *Memcell) { ::glPushMatrix(); @@ -4497,7 +4497,7 @@ void opengl33_renderer::Render(TMemCell *Memcell) ::glPopMatrix(); } -void opengl33_renderer::Render_particles() +void opengl46_renderer::Render_particles() { model_ubs.set_modelview(OpenGLMatrices.data(GL_MODELVIEW)); model_ubo->update(model_ubs); @@ -4507,7 +4507,7 @@ void opengl33_renderer::Render_particles() m_renderpass.draw_stats.particles = m_particlerenderer.render(); } -void opengl33_renderer::Render_vr_models() +void opengl46_renderer::Render_vr_models() { if (!vr) return; @@ -4526,7 +4526,7 @@ void opengl33_renderer::Render_vr_models() ::glPopMatrix(); } -void opengl33_renderer::Render_precipitation() +void opengl46_renderer::Render_precipitation() { if (Global.Overcast <= 1.f) { @@ -4580,7 +4580,7 @@ void opengl33_renderer::Render_precipitation() ::glPopMatrix(); } -void opengl33_renderer::Render_Alpha(scene::basic_region *Region) +void opengl46_renderer::Render_Alpha(scene::basic_region *Region) { // sort the nodes based on their distance to viewer @@ -4589,7 +4589,7 @@ void opengl33_renderer::Render_Alpha(scene::basic_region *Region) Render_Alpha(std::rbegin(m_cellqueue), std::rend(m_cellqueue)); } -void opengl33_renderer::Render_Alpha(cell_sequence::reverse_iterator First, cell_sequence::reverse_iterator Last) +void opengl46_renderer::Render_Alpha(cell_sequence::reverse_iterator First, cell_sequence::reverse_iterator Last) { // NOTE: this method is launched only during color pass therefore we don't bother with mode test here @@ -4679,7 +4679,7 @@ void opengl33_renderer::Render_Alpha(cell_sequence::reverse_iterator First, cell } } -void opengl33_renderer::Render_Alpha(TAnimModel *Instance) +void opengl46_renderer::Render_Alpha(TAnimModel *Instance) { if (false == Instance->m_visible) { return; } @@ -4741,7 +4741,7 @@ void opengl33_renderer::Render_Alpha(TAnimModel *Instance) } } -void opengl33_renderer::Render_Alpha(TTraction *Traction) +void opengl46_renderer::Render_Alpha(TTraction *Traction) { glDebug("Render_Alpha TTraction"); @@ -4786,7 +4786,7 @@ void opengl33_renderer::Render_Alpha(TTraction *Traction) glLineWidth(1.0f); } -void opengl33_renderer::Render_editor_overlay() +void opengl46_renderer::Render_editor_overlay() { if (false == EditorModeFlag || EditorOverlay.batches.empty()) return; @@ -4835,7 +4835,7 @@ void opengl33_renderer::Render_editor_overlay() ::glPopMatrix(); } -void opengl33_renderer::Render_Alpha(scene::lines_node const &Lines) +void opengl46_renderer::Render_Alpha(scene::lines_node const &Lines) { glDebug("Render_Alpha scene::lines_node"); @@ -4868,7 +4868,7 @@ void opengl33_renderer::Render_Alpha(scene::lines_node const &Lines) glLineWidth(1.0f); } -bool opengl33_renderer::Render_Alpha(TDynamicObject *Dynamic) +bool opengl46_renderer::Render_Alpha(TDynamicObject *Dynamic) { if (!Global.render_cab && Global.pCamera.m_owner == Dynamic) return false; @@ -4949,7 +4949,7 @@ bool opengl33_renderer::Render_Alpha(TDynamicObject *Dynamic) return true; } -bool opengl33_renderer::Render_Alpha(TModel3d *Model, material_data const *Material, float const Squaredistance) +bool opengl46_renderer::Render_Alpha(TModel3d *Model, material_data const *Material, float const Squaredistance) { auto alpha = (Material != nullptr ? Material->textures_alpha : 0x30300030); @@ -4975,7 +4975,7 @@ bool opengl33_renderer::Render_Alpha(TModel3d *Model, material_data const *Mater return true; } -bool opengl33_renderer::Render_Alpha(TModel3d *Model, material_data const *Material, float const Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle) +bool opengl46_renderer::Render_Alpha(TModel3d *Model, material_data const *Material, float const Squaredistance, glm::dvec3 const &Position, glm::vec3 const &Angle) { ::glPushMatrix(); ::glTranslated(Position.x, Position.y, Position.z); @@ -4994,7 +4994,7 @@ bool opengl33_renderer::Render_Alpha(TModel3d *Model, material_data const *Mater } // characters of a text display, laid out in a row. the text can be encoded in utf-8 or in windows-1250 -void opengl33_renderer::Render_Alpha_text(TSubModel *Submodel) +void opengl46_renderer::Render_Alpha_text(TSubModel *Submodel) { if (TSubModel::pasText == nullptr) { @@ -5008,7 +5008,7 @@ void opengl33_renderer::Render_Alpha_text(TSubModel *Submodel) } } -void opengl33_renderer::Render_Alpha(TSubModel *Submodel) +void opengl46_renderer::Render_Alpha(TSubModel *Submodel) { // renderowanie przezroczystych przez DL if ((Submodel->iVisible) && (TSubModel::fSquareDist >= Submodel->fSquareMinDist) && (TSubModel::fSquareDist < Submodel->fSquareMaxDist) && (false == m_previewing || Submodel->fVisible > 0.f)) @@ -5250,7 +5250,7 @@ void opengl33_renderer::Render_Alpha(TSubModel *Submodel) Render_Alpha(Submodel->Next); }; -bool opengl33_renderer::Debug_Ui_State(std::optional param) +bool opengl46_renderer::Debug_Ui_State(std::optional param) { if (param) { debug_ui_active = *param; @@ -5260,7 +5260,7 @@ bool opengl33_renderer::Debug_Ui_State(std::optional param) } // utility methods -void opengl33_renderer::Update_Pick_Control() +void opengl46_renderer::Update_Pick_Control() { if (!m_picking_pbo->is_busy()) { @@ -5305,7 +5305,7 @@ void opengl33_renderer::Update_Pick_Control() } } -void opengl33_renderer::Update_Pick_Node() +void opengl46_renderer::Update_Pick_Node() { if (!m_picking_node_pbo->is_busy()) { @@ -5344,7 +5344,7 @@ void opengl33_renderer::Update_Pick_Node() } } -void opengl33_renderer::Pick_Control_Callback(std::function callback) +void opengl46_renderer::Pick_Control_Callback(std::function callback) { if (!Global.render_cab) { callback(nullptr, glm::vec2()); @@ -5353,12 +5353,12 @@ void opengl33_renderer::Pick_Control_Callback(std::function callback) +void opengl46_renderer::Pick_Node_Callback(std::function callback) { m_node_pick_requests.push_back(callback); } -glm::dvec3 opengl33_renderer::Update_Mouse_Position() +glm::dvec3 opengl46_renderer::Update_Mouse_Position() { if (!m_depth_pointer_pbo->is_busy()) { @@ -5411,7 +5411,7 @@ glm::dvec3 opengl33_renderer::Update_Mouse_Position() return m_colorpass.pass_camera.position() + glm::dvec3{m_worldmousecoordinates}; } -void opengl33_renderer::Update(double const Deltatime) +void opengl46_renderer::Update(double const Deltatime) { Update_Pick_Control(); Update_Pick_Node(); @@ -5500,19 +5500,19 @@ void opengl33_renderer::Update(double const Deltatime) } // debug performance string -std::string const &opengl33_renderer::info_times() const +std::string const &opengl46_renderer::info_times() const { return m_debugtimestext; } -std::string const &opengl33_renderer::info_stats() const +std::string const &opengl46_renderer::info_stats() const { return m_debugstatstext; } -void opengl33_renderer::MakeScreenshot() +void opengl46_renderer::MakeScreenshot() { screenshot_manager::make_screenshot(); } @@ -5530,7 +5530,7 @@ float const preview_fieldofview{30.f}; float const preview_background{16.f}; } // namespace -void opengl33_renderer::Preview_Bounds(TSubModel const *Submodel, glm::dmat4 const &Transform, glm::dvec3 &Min, glm::dvec3 &Max) const +void opengl46_renderer::Preview_Bounds(TSubModel const *Submodel, glm::dmat4 const &Transform, glm::dvec3 &Min, glm::dvec3 &Max) const { // same walk as the one of Render(TSubModel *) bar the range checks, which leave out parts only for the bounds to be smaller for (auto const *submodel{Submodel}; submodel != nullptr; submodel = submodel->Next) @@ -5557,7 +5557,7 @@ void opengl33_renderer::Preview_Bounds(TSubModel const *Submodel, glm::dmat4 con } } -bool opengl33_renderer::Preview_Targets(int const Size) +bool opengl46_renderer::Preview_Targets(int const Size) { if (m_preview.size == Size) { @@ -5597,7 +5597,7 @@ bool opengl33_renderer::Preview_Targets(int const Size) return true; } -void opengl33_renderer::Preview_Model(TAnimModel *Instance, float const Squaredistance, bool const Alpha) +void opengl46_renderer::Preview_Model(TAnimModel *Instance, float const Squaredistance, bool const Alpha) { // the placement of Render(TAnimModel *), without its range and visibility tests ::glPushMatrix(); @@ -5619,7 +5619,7 @@ void opengl33_renderer::Preview_Model(TAnimModel *Instance, float const Squaredi ::glPopMatrix(); } -void opengl33_renderer::Preview_Color(TAnimModel *Instance, float const Squaredistance, int const Size, glm::dvec3 const &Eye, glm::mat4 const &View, glm::mat4 const &Projection, bool const Shadows) +void opengl46_renderer::Preview_Color(TAnimModel *Instance, float const Squaredistance, int const Size, glm::dvec3 const &Eye, glm::mat4 const &View, glm::mat4 const &Projection, bool const Shadows) { m_renderpass.draw_mode = rendermode::color; m_renderpass.pass_camera.position() = Eye; @@ -5687,7 +5687,7 @@ void opengl33_renderer::Preview_Color(TAnimModel *Instance, float const Squaredi setup_shadow_unbind_map(); } -bool opengl33_renderer::Render_Preview(TAnimModel *Instance, int const Size, int const Margin, bool const Shadows, std::vector &Image) +bool opengl46_renderer::Render_Preview(TAnimModel *Instance, int const Size, int const Margin, bool const Shadows, std::vector &Image) { if ((Instance == nullptr) || (Instance->pModel == nullptr) || (Size <= 0) || (Margin < 0) || (Margin * 2 >= Size)) { @@ -5714,7 +5714,7 @@ bool opengl33_renderer::Render_Preview(TAnimModel *Instance, int const Size, int glfwMakeContextCurrent(m_window); opengl_texture::reset_unit_cache(); - gfx::opengl33_vaogeometrybank::reset(); + gfx::opengl46_vaogeometrybank::reset(); m_previewing = true; // lights and visibility of the submodels, for this instance Instance->RaAnimate(m_framestamp); @@ -5860,7 +5860,7 @@ bool opengl33_renderer::Render_Preview(TAnimModel *Instance, int const Size, int glDisable(GL_FRAMEBUFFER_SRGB); opengl_texture::reset_unit_cache(); // the post processing binds its own vertex array, which the geometry banks don't know about - gfx::opengl33_vaogeometrybank::reset(); + gfx::opengl46_vaogeometrybank::reset(); auto const targetpixels{static_cast(targetsize) * targetsize}; std::vector colors(targetpixels * 4); @@ -5924,7 +5924,7 @@ bool opengl33_renderer::Render_Preview(TAnimModel *Instance, int const Size, int return true; } -void opengl33_renderer::Update_Lights(light_array &Lights) +void opengl46_renderer::Update_Lights(light_array &Lights) { glDebug("Update_Lights"); @@ -6088,7 +6088,7 @@ void opengl33_renderer::Update_Lights(light_array &Lights) light_ubo->update(light_ubs); } -bool opengl33_renderer::Init_caps() +bool opengl46_renderer::Init_caps() { std::string gl_renderer((char *)glGetString(GL_RENDERER)); std::string gl_vendor((char *)glGetString(GL_VENDOR)); @@ -6185,46 +6185,46 @@ bool opengl33_renderer::Init_caps() return true; } -glm::vec3 opengl33_renderer::pick_color(std::size_t const Index) +glm::vec3 opengl46_renderer::pick_color(std::size_t const Index) { return glm::vec3{((Index & 0xff0000) >> 16) / 255.0f, ((Index & 0x00ff00) >> 8) / 255.0f, (Index & 0x0000ff) / 255.0f}; } -std::size_t opengl33_renderer::pick_index(glm::ivec3 const &Color) +std::size_t opengl46_renderer::pick_index(glm::ivec3 const &Color) { return Color.b + (Color.g * 256) + (Color.r * 256 * 256); } -std::unique_ptr opengl33_renderer::create_func() +std::unique_ptr opengl46_renderer::create_func() { - return std::unique_ptr(new opengl33_renderer()); + return std::unique_ptr(new opengl46_renderer()); } -bool opengl33_renderer::renderer_register = gfx_renderer_factory::get_instance()->register_backend("modern", opengl33_renderer::create_func); +bool opengl46_renderer::renderer_register = gfx_renderer_factory::get_instance()->register_backend("modern", opengl46_renderer::create_func); -bool opengl33_renderer::opengl33_imgui_renderer::Init() +bool opengl46_renderer::opengl46_imgui_renderer::Init() { crashreport_add_info("imgui_ver", "gl3"); return ImGui_ImplOpenGL3_Init("#version 330 core"); } -void opengl33_renderer::opengl33_imgui_renderer::Shutdown() +void opengl46_renderer::opengl46_imgui_renderer::Shutdown() { ImGui_ImplOpenGL3_Shutdown(); } -void opengl33_renderer::opengl33_imgui_renderer::BeginFrame() +void opengl46_renderer::opengl46_imgui_renderer::BeginFrame() { ImGui_ImplOpenGL3_NewFrame(); } -void opengl33_renderer::opengl33_imgui_renderer::Render() +void opengl46_renderer::opengl46_imgui_renderer::Render() { gl::buffer::unbind(gl::buffer::ARRAY_BUFFER); ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); } -std::uint64_t opengl33_renderer::opengl33_imgui_renderer::Create_Image(std::uint8_t const *Rgba, int const Width, int const Height) +std::uint64_t opengl46_renderer::opengl46_imgui_renderer::Create_Image(std::uint8_t const *Rgba, int const Width, int const Height) { // the ui colours are made linear in its shaders, the image is too, by sampling it as srgb. the bindings the renderer // keeps track of are put back as they were @@ -6248,7 +6248,7 @@ std::uint64_t opengl33_renderer::opengl33_imgui_renderer::Create_Image(std::uint return image; } -void opengl33_renderer::opengl33_imgui_renderer::Release_Image(std::uint64_t const Image) +void opengl46_renderer::opengl46_imgui_renderer::Release_Image(std::uint64_t const Image) { auto const image{static_cast(Image)}; glDeleteTextures(1, &image); diff --git a/rendering/opengl33renderer.h b/rendering/opengl46/opengl46renderer.h similarity index 97% rename from rendering/opengl33renderer.h rename to rendering/opengl46/opengl46renderer.h index b580e39f..113e7343 100644 --- a/rendering/opengl33renderer.h +++ b/rendering/opengl46/opengl46renderer.h @@ -11,10 +11,10 @@ http://mozilla.org/MPL/2.0/. #include "rendering/renderer.h" #include "rendering/openglcamera.h" -#include "rendering/opengl33light.h" -#include "rendering/opengl33particles.h" -#include "rendering/opengl33skydome.h" -#include "rendering/opengl33precipitation.h" +#include "rendering/opengl46/opengl46light.h" +#include "rendering/opengl46/opengl46particles.h" +#include "rendering/opengl46/opengl46skydome.h" +#include "rendering/opengl46/opengl46precipitation.h" #include "simulation/simulationenvironment.h" #include "scene/scene.h" #include "world/MemCell.h" @@ -29,15 +29,15 @@ http://mozilla.org/MPL/2.0/. #include "gl/glsl_common.h" #include "gl/pbo.h" #include "gl/query.h" -#include "rendering/opengl33terrain.h" +#include "rendering/opengl46/opengl46terrain.h" // bare-bones render controller, in lack of anything better yet -class opengl33_renderer : public gfx_renderer { +class opengl46_renderer : public gfx_renderer { public: // constructors - opengl33_renderer() = default; + opengl46_renderer() = default; // destructor - ~opengl33_renderer() {} + ~opengl46_renderer() {} // methods bool Init( GLFWwindow *Window ) override; @@ -260,7 +260,7 @@ class opengl33_renderer : public gfx_renderer { viewport_config *m_current_viewport = nullptr; - typedef std::vector opengllight_array; + typedef std::vector opengllight_array; // methods std::unique_ptr make_shader(std::string v, std::string f); @@ -355,8 +355,8 @@ class opengl33_renderer : public gfx_renderer { gfx::geometrybank_manager m_geometry; material_manager m_materials; texture_manager m_textures; - opengl33_terrain_materials m_terrainmaterials{m_materials, m_textures}; - opengl33_light m_sunlight; + opengl46_terrain_materials m_terrainmaterials{m_materials, m_textures}; + opengl46_light m_sunlight; opengllight_array m_lights; /* float m_sunandviewangle; // cached dot product of sunlight and camera vectors @@ -377,9 +377,9 @@ class opengl33_renderer : public gfx_renderer { bool m_environmentready{false}; // the environment map was drawn whole at least once double m_environmentupdatetime{0}; // time of the most recent environment map update glm::dvec3 m_environmentupdatelocation; // coordinates of most recent environment map update - opengl33_skydome m_skydomerenderer; - opengl33_precipitation m_precipitationrenderer; - opengl33_particles m_particlerenderer; // particle visualization subsystem + opengl46_skydome m_skydomerenderer; + opengl46_precipitation m_precipitationrenderer; + opengl46_particles m_particlerenderer; // particle visualization subsystem unsigned int m_framestamp; // id of currently rendered gfx frame float m_framerate; @@ -576,7 +576,7 @@ class opengl33_renderer : public gfx_renderer { static bool renderer_register; - class opengl33_imgui_renderer : public imgui_renderer + class opengl46_imgui_renderer : public imgui_renderer { virtual bool Init() override; virtual void Shutdown() override; diff --git a/rendering/opengl33skydome.cpp b/rendering/opengl46/opengl46skydome.cpp similarity index 95% rename from rendering/opengl33skydome.cpp rename to rendering/opengl46/opengl46skydome.cpp index cbceeed4..74a4abe1 100644 --- a/rendering/opengl33skydome.cpp +++ b/rendering/opengl46/opengl46skydome.cpp @@ -8,11 +8,11 @@ http://mozilla.org/MPL/2.0/. */ #include "stdafx.h" -#include "rendering/opengl33skydome.h" +#include "rendering/opengl46/opengl46skydome.h" #include "simulation/simulationenvironment.h" -void opengl33_skydome::update() { +void opengl46_skydome::update() { if (!m_shader) { @@ -55,7 +55,7 @@ void opengl33_skydome::update() { } // render skydome to screen -void opengl33_skydome::render() { +void opengl46_skydome::render() { if( ( !m_shader) || ( !m_vao ) ) { return; } diff --git a/rendering/opengl33skydome.h b/rendering/opengl46/opengl46skydome.h similarity index 87% rename from rendering/opengl33skydome.h rename to rendering/opengl46/opengl46skydome.h index 287ac511..afb3bd38 100644 --- a/rendering/opengl33skydome.h +++ b/rendering/opengl46/opengl46skydome.h @@ -13,13 +13,13 @@ http://mozilla.org/MPL/2.0/. #include "gl/shader.h" #include "gl/buffer.h" -class opengl33_skydome { +class opengl46_skydome { public: // constructors - opengl33_skydome() = default; + opengl46_skydome() = default; // destructor - ~opengl33_skydome() = default; + ~opengl46_skydome() = default; // methods // updates data stores on the opengl end. NOTE: unbinds buffers void update(); diff --git a/rendering/opengl33terrain.cpp b/rendering/opengl46/opengl46terrain.cpp similarity index 95% rename from rendering/opengl33terrain.cpp rename to rendering/opengl46/opengl46terrain.cpp index 019cb5f2..bfca0a20 100644 --- a/rendering/opengl33terrain.cpp +++ b/rendering/opengl46/opengl46terrain.cpp @@ -8,9 +8,9 @@ http://mozilla.org/MPL/2.0/. */ #include "stdafx.h" -#include "rendering/opengl33terrain.h" +#include "rendering/opengl46/opengl46terrain.h" -#include "rendering/opengl33geometrybank.h" +#include "rendering/opengl46/opengl46geometrybank.h" #include "utilities/Globals.h" #include "utilities/Logs.h" @@ -39,7 +39,7 @@ void set_anisotropy(GLenum const Target) } // namespace -bool opengl33_terrain_materials::init() +bool opengl46_terrain_materials::init() { if (m_state != 0) return m_state > 0; @@ -91,7 +91,7 @@ bool opengl33_terrain_materials::init() return true; } -texture_handle opengl33_terrain_materials::make_texture(std::string const &Name, GLenum const Target) +texture_handle opengl46_terrain_materials::make_texture(std::string const &Name, GLenum const Target) { auto const handle{m_textures.create(Name, false, GL_RGBA)}; auto &texture{m_textures.texture(handle)}; @@ -107,7 +107,7 @@ texture_handle opengl33_terrain_materials::make_texture(std::string const &Name, return handle; } -void opengl33_terrain_materials::make_storage(texture_array &Array, int const Layers) +void opengl46_terrain_materials::make_storage(texture_array &Array, int const Layers) { auto &texture{m_textures.texture(Array.handle)}; bind_for_upload(texture); @@ -124,7 +124,7 @@ void opengl33_terrain_materials::make_storage(texture_array &Array, int const La texture.data_components = GL_RGBA; } -int opengl33_terrain_materials::layer_index(gfx::terrain_layer const &Layer) +int opengl46_terrain_materials::layer_index(gfx::terrain_layer const &Layer) { for (auto const &existing : m_layers) if (existing.material == Layer.material && existing.size == Layer.size) @@ -167,7 +167,7 @@ int opengl33_terrain_materials::layer_index(gfx::terrain_layer const &Layer) return entry.index; } -std::size_t opengl33_terrain_materials::acquire_slot(material_handle const Reuse) +std::size_t opengl46_terrain_materials::acquire_slot(material_handle const Reuse) { if (Reuse != null_handle) { @@ -234,7 +234,7 @@ std::size_t opengl33_terrain_materials::acquire_slot(material_handle const Reuse return index; } -material_handle opengl33_terrain_materials::make(material_handle const Reuse, std::vector const &Layers, int const Samples, std::uint8_t const *Weights, glm::vec3 const &Placement) +material_handle opengl46_terrain_materials::make(material_handle const Reuse, std::vector const &Layers, int const Samples, std::uint8_t const *Weights, glm::vec3 const &Placement) { if (Layers.empty() || false == init()) return null_handle; @@ -303,7 +303,7 @@ material_handle opengl33_terrain_materials::make(material_handle const Reuse, st return entry.material; } -void opengl33_terrain_materials::release(material_handle const Material) +void opengl46_terrain_materials::release(material_handle const Material) { auto const lookup{m_slotof.find(Material)}; if (lookup == m_slotof.end() || false == m_slots[lookup->second].used) @@ -312,7 +312,7 @@ void opengl33_terrain_materials::release(material_handle const Material) m_free.push_back(lookup->second); } -bool opengl33_terrain_materials::copy_layer(layer &Layer) +bool opengl46_terrain_materials::copy_layer(layer &Layer) { auto const &material{m_materials.material(Layer.material)}; auto const slot = [&](char const *Name, int const Fallback) { @@ -378,7 +378,7 @@ bool opengl33_terrain_materials::copy_layer(layer &Layer) return true; } -void opengl33_terrain_materials::update() +void opengl46_terrain_materials::update() { if (false == m_pending || m_state <= 0) return; @@ -430,5 +430,5 @@ void opengl33_terrain_materials::update() ::glDisable(GL_FRAMEBUFFER_SRGB); ::glDepthMask(GL_TRUE); opengl_texture::reset_unit_cache(); - gfx::opengl33_vaogeometrybank::reset(); + gfx::opengl46_vaogeometrybank::reset(); } diff --git a/rendering/opengl33terrain.h b/rendering/opengl46/opengl46terrain.h similarity index 96% rename from rendering/opengl33terrain.h rename to rendering/opengl46/opengl46terrain.h index 60d12113..35fe49ff 100644 --- a/rendering/opengl33terrain.h +++ b/rendering/opengl46/opengl46terrain.h @@ -23,10 +23,10 @@ http://mozilla.org/MPL/2.0/. // materials of the heightmap terrain for the opengl 3.3 renderer (shader mat_terrain). // the textures of the layer materials are copied into texture arrays shared by all chunks; each chunk gets a material // of its own, with textures holding the weights of its layers and a table of what its layers are -class opengl33_terrain_materials +class opengl46_terrain_materials { public: - opengl33_terrain_materials(material_manager &Materials, texture_manager &Textures) : m_materials(Materials), m_textures(Textures) {} + opengl46_terrain_materials(material_manager &Materials, texture_manager &Textures) : m_materials(Materials), m_textures(Textures) {} // see gfx_renderer::Terrain_Material. returns null_handle if the terrain shader can't be used material_handle make(material_handle const Reuse, std::vector const &Layers, int const Samples, std::uint8_t const *Weights, glm::vec3 const &Placement); diff --git a/scene/scene.h b/scene/scene.h index c2369584..400fdac3 100644 --- a/scene/scene.h +++ b/scene/scene.h @@ -26,7 +26,7 @@ http://mozilla.org/MPL/2.0/. #include "input/command.h" #include "utilities/utilities.h" -class opengl33_renderer; +class opengl46_renderer; namespace scene { @@ -95,7 +95,7 @@ struct terrain_block { // TBD, TODO: replace with quadtree scheme? class basic_cell { - friend opengl33_renderer; + friend opengl46_renderer; public: // constructors @@ -292,7 +292,7 @@ public: // basic scene partitioning structure, holds terrain geometry and collection of cells class basic_section { - friend opengl33_renderer; + friend opengl46_renderer; public: // constructors @@ -415,7 +415,7 @@ public: // top-level of scene spatial structure, holds collection of sections class basic_region { - friend opengl33_renderer; + friend opengl46_renderer; public: // constructors diff --git a/simulation/simulationenvironment.h b/simulation/simulationenvironment.h index 84082470..fcc93584 100644 --- a/simulation/simulationenvironment.h +++ b/simulation/simulationenvironment.h @@ -17,12 +17,12 @@ http://mozilla.org/MPL/2.0/. #include "rendering/precipitation.h" #include "audio/sound.h" -class opengl33_renderer; +class opengl46_renderer; // wrapper for environment elements -- sky, sun, stars, clouds etc class world_environment { - friend opengl33_renderer; + friend opengl46_renderer; public: // methods diff --git a/utilities/Classes.h b/utilities/Classes.h index f4bb3c7a..88e0ddd3 100644 --- a/utilities/Classes.h +++ b/utilities/Classes.h @@ -12,7 +12,7 @@ http://mozilla.org/MPL/2.0/. //--------------------------------------------------------------------------- // Ra: zestaw klas do robienia wskaźników, aby uporządkować nagłówki //--------------------------------------------------------------------------- -class opengl33_renderer; +class opengl46_renderer; class TTrack; // odcinek trajektorii class basic_event; class TTrain; // pojazd sterowany diff --git a/vehicle/DynObj.h b/vehicle/DynObj.h index 687dafe4..da7b347d 100644 --- a/vehicle/DynObj.h +++ b/vehicle/DynObj.h @@ -188,7 +188,7 @@ struct material_data { class TDynamicObject { // klasa pojazdu - friend opengl33_renderer; + friend opengl46_renderer; public: static bool bDynamicRemove; // moved from ground diff --git a/widgets/map.cpp b/widgets/map.cpp index 195fed6c..6d098b0f 100644 --- a/widgets/map.cpp +++ b/widgets/map.cpp @@ -16,7 +16,7 @@ ui::map_panel::map_panel() : ui_panel(STR_C("Map"), false) window_flags = ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse; #ifdef WITH_OPENGL_MODERN - opengl33_renderer *gl33 = dynamic_cast(GfxRenderer.get()); + opengl46_renderer *gl33 = dynamic_cast(GfxRenderer.get()); if (!gl33) { ErrorLog("map not supported on old renderer"); return; @@ -144,7 +144,7 @@ void ui::map_panel::render_map_texture(glm::mat4 transform, glm::vec2 surface_si scene_ubo->bind_uniform(); #ifdef WITH_OPENGL_MODERN - opengl33_renderer *gl33 = dynamic_cast(GfxRenderer.get()); + opengl46_renderer *gl33 = dynamic_cast(GfxRenderer.get()); gl33->Draw_Geometry(m_section_handles.begin(), m_section_handles.end()); @@ -421,7 +421,7 @@ void ui::handle_map_object_hover(std::shared_ptr &obj) for (int i = 0; i < iMaxNumLights; i++) { #ifdef WITH_OPENGL_MODERN - dynamic_cast(GfxRenderer.get())->Update_AnimModel(model); // update lamp opacities + dynamic_cast(GfxRenderer.get())->Update_AnimModel(model); // update lamp opacities #endif auto state = model->LightGet(i); if (!state) @@ -477,7 +477,7 @@ void ui::semaphore_window::render_content() for (int i = 0; i < iMaxNumLights; i++) { #ifdef WITH_OPENGL_MODERN - dynamic_cast(GfxRenderer.get())->Update_AnimModel(model); // update lamp opacities + dynamic_cast(GfxRenderer.get())->Update_AnimModel(model); // update lamp opacities #endif auto state = model->LightGet(i); if (!state) diff --git a/widgets/map.h b/widgets/map.h index 9cb8a064..3a673ddf 100644 --- a/widgets/map.h +++ b/widgets/map.h @@ -8,7 +8,7 @@ #include "gl/framebuffer.h" #include "rendering/frustum.h" #ifdef WITH_OPENGL_MODERN -#include "rendering/opengl33renderer.h" +#include "rendering/opengl46/opengl46renderer.h" #endif namespace ui diff --git a/world/Track.h b/world/Track.h index 51bb1d6b..24ad732b 100644 --- a/world/Track.h +++ b/world/Track.h @@ -151,7 +151,7 @@ private: // trajektoria ruchu - opakowanie class TTrack : public scene::basic_node { - friend opengl33_renderer; + friend opengl46_renderer; // NOTE: temporary arrangement friend itemproperties_panel; friend class editor_track; diff --git a/world/Traction.h b/world/Traction.h index 6a041f28..54e71d1c 100644 --- a/world/Traction.h +++ b/world/Traction.h @@ -20,7 +20,7 @@ class TTractionPowerSource; class TTraction : public scene::basic_node { - friend opengl33_renderer; + friend opengl46_renderer; public: // na razie TTractionPowerSource *psPower[ 2 ] { nullptr, nullptr }; // najbliższe zasilacze z obu kierunków