~eliasnaur/gio

ref: 284659d3eac9 gio/app/headless/headless.go -rw-r--r-- 2.8 KiB
gpu: don't automatically clear screen before rendering

Gio UI may be overlaid on top of custom graphics such as in the glfw example.
That will only work if Gio doesn't clear the screen (to white).

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gpu: make GPU an interface to prepare for second implementation

While here, merge BeginFrame and EndFrame; the split was done for
performance reasons, yet never measured.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless: avoid race between ReleaseCurrent and MakeCurrent

Release context on MakeCurrent failure paths as well.

Fixes gio#144

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless,internal/rendertest: report errors from headless renders

Updates gio#144

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless: don't release context while it's current

Updates gio#144

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless,gpu/gl: make ReadPixels y-flipping backend specific

The Direct3D backend doesn't need y-flipping, so don't do it unconditionally in
package app/headless.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless: add lower-level backend tests

Add a series of low level gpu.Backend tests to assure the correct behaviour of
Backends. The immediate use is debugging of the Direct3D port, in the future
for developing new backends.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless: setup default Viewport in NewWindow

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gpu/backend: move backend interface types to a separate package

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless: handle error from Framebuffer.ReadPixels

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless: remove unusued parameters to newContext

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gpu: Move Bind methods to Backend

Having Backend.Bind* methods better matches both opengl and d3d.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless: re-implement Screenshot on top of Backend

The new Framebuffer.ReadPixels method is enough to implement
Window.Screenshot. Use that instead of the OpenGL-specific
implementation.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/headless: remove OpenGL assumptions

To prepare package headless for multiple backends, refactor the common headless
driver to no longer assume an OpenGL context. Instead, introduce a headless
backend type and the OpenGL implementation, glBackend.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app,app/headless: expose Backends from window and headless contexts

This is a refactoring change to prepare for another gpu.Backend
implementations.

Notably, app/loop.go no longer imports gpu/gl.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/internal/srgb: move sRGB emulation to new internal package

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gpu,gpu/gl: introduce Backend

A recent change made the OpenGL functions an interface of the functions
required for the implementation of GPU, a renderer for Gio operations.
That allowed for running Gio on external systems where OpenGL is
available.

However, to allow for non-OpenGL flavored backends such as Vulkan,
Metal and Direct3D, this change introduces Backend for the high-level
operations required by GPU. This change also adds a concrete backend
to package gl.

Type Backend is a first cut heavily based on OpenGL. Future changes will add
more backends, where the Backend interface quite possibly will need refinement.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gpu: rename method GPU.Frame to BeginFrame and drop redundant argument

The viewport size was already specified in the call to Collect.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
gpu: expose the rendering implementation

The rendering implementation is needed for using Gio UI with external
window libraries such as GLFW. Expose it in the new package gpu.

Updates #26

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/internal/gpu: remove profile flag

Automatically determine whether to profile GPU operations from
the existence of a profiling op.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
app/internal/gl/impl: extract platform dependent opengl bindings

We'd like to support Gio using a different renderer binding than
the builtin. A first step is to define the Functions interface
in package gl, and extract the concrete implementations to a
separate package.

Updates #26

Signed-off-by: Elias Naur <mail@eliasnaur.com>
Next