As noted in #49, GL_EXT_color_buffer_half_float is required for
GL_OES_texture_half_float to be useful for FBOs.
Updates #49
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Remove dependency on EXT_color_buffer_half_float, it's not clear it's
necessary. In any case the following FBO sanity check will catch invalid
FBO format combinations.
Updates #49
Signed-off-by: Elias Naur <mail@eliasnaur.com>
macOS supports the OpenGL core profiles where glGetString(GL_EXTENSIONS)
is not supported. Use glGetStringi(GL_EXTENSIONS, <index>) instead.
The wrong query didn't make any practical difference because Gio doesn't
need any extensions on OpenGL 3 and better.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The macOS backend uses a desktop OpenGL context, not a OpenGL ES
context. The main difference is that sRGB have to be enabled and
a vertex buffer must be bound.
Do that and fix Window.Screenshot for scenes more complex than a
glClear.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Before this change the default material were a texture, which leads
to a crash when no texture is current.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The origin of image.Images is the upper left corner. Convert the
ReadPixels result by flipping the image the y-direction.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
EGL contexts don't need locking, so their Lock and Unlock methods
are empty. Remove them and add them where necessary instead.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The policy of rendering on a separate goroutine is separate from
the actual rendering. Reflect that by introducing the RenderLoop
type for driving a GPU from a separate goroutine.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Instead of calling from the low level context into the window
for its surface and dimensions, add a Context.MakeCurrent method
that does it directly.
The result is simpler and clearer logic. For example, synchronization
is obviously no longer needed. It wasn't necessary before, but the
reason was unclear.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
For Windows:
- Add shift/ctrl/etc modifiers to mouse events, so you can recognize the
difference between "click" and "shift-click".
- Add several allowed punctuation characters as single key events, so
you can (for example) use "." as a hotkey.
Signed-off-by: Larry Clapp <larry@theclapp.org>
RegisterFragment creates an instance of a Java class and registers
it as a Fragment in the window's Context.
Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
Allows things like "ctrl-{" and ".".
All punctuation is returned as-is, e.g. "!" is "!", not "shift-1", and
"{" is "{", not "shift-[".
Also add the Enter key as a known key (fn-return on my Mac).
Signed-off-by: Larry Clapp <larry@theclapp.org>
ICCCM 4.1.2 says WMs will examine client properties every time
window is mapped. Because SetWMProtocols is called before MapWindow
some WMs (specifically taowm) never see them.
In other WMs this works because they check for WM_DELETE_WINDOW
when user tries to close window, not when window is mapped.
Signed-off-by: Konstantin Kulikov <k.kulikov2@gmail.com>
The DestroyEvent ack allows the backend to release the window.
Ensure that the GPU associated with the window is done before that
happens.
Updates gio#67
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Removed redundant XSelectInput and XChangeWindowAttributes as well as
obsolete screen parameter in x11DetectUIScale.
Signed-off-by: Denis Bernard <db047h@gmail.com>