Move app command state mapping to renderer gl
This commit is contained in:
@@ -157,7 +157,8 @@ Known local toolchain state:
|
|||||||
mapping used by `Shader` active-uniform discovery and the uniform uniqueness
|
mapping used by `Shader` active-uniform discovery and the uniform uniqueness
|
||||||
check. App OpenGL initialization debug severity, debug output, GL info string,
|
check. App OpenGL initialization debug severity, debug output, GL info string,
|
||||||
default depth/program-point/line-smooth state, blend factor/equation, and UI
|
default depth/program-point/line-smooth state, blend factor/equation, and UI
|
||||||
render-target RGBA8 format tokens are cataloged and tested here too.
|
render-target RGBA8 format tokens are cataloged and tested here too, including
|
||||||
|
the legacy convert command and resize path.
|
||||||
- `windows-msvc-vcpkg-headless` validates manifest install/configure/build/test
|
- `windows-msvc-vcpkg-headless` validates manifest install/configure/build/test
|
||||||
for the current headless component matrix; see DEBT-0007 for remaining app
|
for the current headless component matrix; see DEBT-0007 for remaining app
|
||||||
and platform triplet migration.
|
and platform triplet migration.
|
||||||
|
|||||||
@@ -422,7 +422,8 @@ delegate to `pp_renderer_gl` as well. `Shader` no longer spells GL enum names
|
|||||||
directly. App OpenGL initialization debug severity, debug output, GL info
|
directly. App OpenGL initialization debug severity, debug output, GL info
|
||||||
string, default depth/program-point/line-smooth state, blend factor/equation,
|
string, default depth/program-point/line-smooth state, blend factor/equation,
|
||||||
and UI render-target RGBA8 format tokens are now also cataloged and tested in
|
and UI render-target RGBA8 format tokens are now also cataloged and tested in
|
||||||
`pp_renderer_gl`. The existing renderer classes are not yet fully
|
`pp_renderer_gl`; the legacy convert command and resize path consume the same
|
||||||
|
backend-owned mapping. The existing renderer classes are not yet fully
|
||||||
behind the renderer interfaces.
|
behind the renderer interfaces.
|
||||||
|
|
||||||
Implementation tasks:
|
Implementation tasks:
|
||||||
|
|||||||
@@ -1,16 +1,46 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "canvas.h"
|
#include "canvas.h"
|
||||||
|
#include "renderer_gl/opengl_capabilities.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
[[nodiscard]] GLenum depth_test_state() noexcept
|
||||||
|
{
|
||||||
|
return static_cast<GLenum>(pp::renderer::gl::depth_test_state());
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] GLenum program_point_size_state() noexcept
|
||||||
|
{
|
||||||
|
return static_cast<GLenum>(pp::renderer::gl::program_point_size_state());
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] GLenum source_alpha_blend_factor() noexcept
|
||||||
|
{
|
||||||
|
return static_cast<GLenum>(pp::renderer::gl::source_alpha_blend_factor());
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] GLenum one_minus_source_alpha_blend_factor() noexcept
|
||||||
|
{
|
||||||
|
return static_cast<GLenum>(pp::renderer::gl::one_minus_source_alpha_blend_factor());
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] GLenum add_blend_equation() noexcept
|
||||||
|
{
|
||||||
|
return static_cast<GLenum>(pp::renderer::gl::add_blend_equation());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void App::cmd_convert(std::string pano_path, std::string out_path)
|
void App::cmd_convert(std::string pano_path, std::string out_path)
|
||||||
{
|
{
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(depth_test_state());
|
||||||
glEnable(GL_PROGRAM_POINT_SIZE);
|
glEnable(program_point_size_state());
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(source_alpha_blend_factor(), one_minus_source_alpha_blend_factor());
|
||||||
glBlendEquation(GL_FUNC_ADD);
|
glBlendEquation(add_blend_equation());
|
||||||
|
|
||||||
Canvas* canvas = new Canvas;
|
Canvas* command_canvas = new Canvas;
|
||||||
canvas->create(CANVAS_RES, CANVAS_RES);
|
command_canvas->create(CANVAS_RES, CANVAS_RES);
|
||||||
canvas->project_open_thread(pano_path);
|
command_canvas->project_open_thread(pano_path);
|
||||||
canvas->export_equirectangular_thread(out_path);
|
command_canvas->export_equirectangular_thread(out_path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
|
#include "renderer_gl/opengl_capabilities.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
[[nodiscard]] GLint rgba8_internal_format() noexcept
|
||||||
|
{
|
||||||
|
return static_cast<GLint>(pp::renderer::gl::rgba8_internal_format());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
void displayKeyboard(bool pShow);
|
void displayKeyboard(bool pShow);
|
||||||
@@ -84,7 +94,7 @@ void App::tick(float dt)
|
|||||||
void App::resize(float w, float h)
|
void App::resize(float w, float h)
|
||||||
{
|
{
|
||||||
LOG("App::resize %d %d", (int)w, (int)h);
|
LOG("App::resize %d %d", (int)w, (int)h);
|
||||||
uirtt.create(w, h, -1, GL_RGBA8, true);
|
uirtt.create(static_cast<int>(w), static_cast<int>(h), -1, rgba8_internal_format(), true);
|
||||||
redraw = true;
|
redraw = true;
|
||||||
width = w;
|
width = w;
|
||||||
height = h;
|
height = h;
|
||||||
|
|||||||
Reference in New Issue
Block a user