Skip to content

(OpenGL) Render Targets#771

Merged
maurhofer-ubique merged 8 commits into
mainfrom
feature/open-gl-render-targets
Jun 17, 2025
Merged

(OpenGL) Render Targets#771
maurhofer-ubique merged 8 commits into
mainfrom
feature/open-gl-render-targets

Conversation

@maurhofer-ubique

Copy link
Copy Markdown
Collaborator
  • Add render targets for OpenGL
  • Move render targets from the RenderPassInterface into the RenderPassConfig (make the easily available in the render calls of a GraphicsObjectInterface)

@stmitt stmitt requested a review from Copilot June 17, 2025 11:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for OpenGL render targets by moving render target handling from RenderPassInterface into RenderPassConfig and updating the native and Kotlin layers to manage offscreen framebuffers.

  • Introduce a nullable renderTarget field in RenderPassConfig and remove the old getRenderTargetInterface method.
  • Update JNI bridge (NativeRenderPassConfig.cpp) to marshal the new renderTarget field.
  • Extend OpenGlContext to create, delete, and resume/pause render targets, and update consumer code (MapView, OffscreenMapRenderer) to iterate over them.

Reviewed Changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bridging/android/jni/graphics/NativeRenderPassConfig.cpp Add optional renderTarget to JNI mapping
android/java/.../RenderPassConfig.kt Add renderTarget: RenderTargetInterface?
android/java/.../RenderPassInterface.kt Remove obsolete getRenderTargetInterface
android/src/.../cpp/graphics/OpenGlRenderTarget.h/.cpp Implement OpenGlRenderTarget for offscreen framebuffer handling
android/src/.../cpp/graphics/OpenGlContext.h/.cpp Implement OpenGlRenderingContextInterface methods and manage targets
android/src/.../MapView.kt, OffscreenMapRenderer.kt Bind, render, and unbind new render targets each frame
android/src/.../SchedulerExtensions.kt Add addGraphicsTask extension for scheduling on GRAPHICS thread
android/build.gradle Update ndkVersion to latest LTS
Comments suppressed due to low confidence (1)

android/src/main/cpp/graphics/OpenGlRenderTarget.cpp:51

  • The <<= operator appears to be a typo; it should be << to append size.y in the log message instead of performing a bitwise assignment.
LogError << "Setup of framebuffer (w=" << size.x << ", h=" << size.y <<= ") failed!";

void OpenGlContext::storeProgram(const std::string &name, int program) { programs[name] = program; }

void OpenGlContext::cleanAll() {
for (const auto &target : renderTargets) {

Copilot AI Jun 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The cleanAll method clears each render target's framebuffer but leaves the renderTargets map entries intact; consider calling renderTargets.clear() afterward if you want to drop stale targets entirely.

Copilot uses AI. Check for mistakes.
@maurhofer-ubique maurhofer-ubique merged commit 97c15f6 into main Jun 17, 2025
6 checks passed
@maurhofer-ubique maurhofer-ubique deleted the feature/open-gl-render-targets branch June 17, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants