Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Drifty Pine

Pages: [1]
1
Feature requests / OpenGL ES 3 (or 2) functionality
« on: July 21, 2021, 09:30:42 pm »
Hello!

I noticed in this thread from last year (April 18, 2020):
https://en.sfml-dev.org/forums/index.php?topic=27129.0
eXpl0it3r mentioned that OpenGL ES 1.1 will be used when SFML_OPENGL_ES is defined.

I am NOT very knowledgeable about OpenGL, but  I did some digging in the SFML code and it seems the version for the context is set by EaglContext::createContext() in "src\SFML\Window\EaglContext.cpp" (and for IOS: "src\SFML\Window\iOS\EaglContext.mm"). Does this actually force the context to be 1, or just make sure it is at least 1?

I ask because the file "src\SFML\Graphics\GLExtensions.hpp" has various defines set, particularly around framebuffer functionality, that map calls to actual functions beyond ES1.

Anyway, ES 2, and especially ES 3, offer some serious added functionality that I noticed is not compiled at all when SFML_OPENGL_ES is defined. For example, ES 3 fully supports glMapBuffer() and glBlitFramebuffer(), and ES 2 with extensions even supports glMapBuffer(). With these available, functions like VertexBuffer::update(const VertexBuffer& vertexBuffer) and Texture::update(const Texture&, unsigned int x, unsigned int y) would be available on ES devices.

Also, the SFML Shader fucntions that currently all return false when SFML_OPENGL_ES is defined could be used under ES 3. Perhaps even more of the Frame Buffer Object functionality provided by RenderTexture also. (For example, "GLExtensions.hpp" still defines GLEXT_framebuffer_blit to false when SFML_OPENGL_ES is defined.)

It seems most devices support at least ES 2 and many support ES 3 now days, isn't that correct?

There are 9 files where SFML_OPENGL_ES is currently used to limit functionality. Are there any plans to revisit these and change/refine the places where SFML_OPENGL_ES is used? Perhaps make more use of the ideas implied in "GLExtensions.hpp" for different ES versions?

As I mentioned, I am a novice with OpenGL, but I am certainly willing to help with any modifications to the 9 files by refining what should and should not get compiled, subject to review by someone else. Is there any interest in this?

Thanks to all involved for a truly wonderful library and for your time reading this message (that got a little longer than I expected)!

[NOTE: I originally posted this article to the wrong forum (Help.General), but I think it more likely belongs here (General.Feature requests) so I deleted the original and re-posted here.

2
Window / Re: Minimize the window
« on: August 10, 2018, 09:55:50 pm »
No need to download anything if all you want to do is minimize on MS-Windows.
Just get the system handle and pass it to the MS-Windows ShowWindow() function:

::ShowWindow(window.getSystemHandle(), SW_MINIMIZE);

('window' in the above call is an sf::Window or sf::RenderWindow)

Make sure to include the MS-Windows header:
#include <windows.h>


3
Window / Re: Maximize Window
« on: August 10, 2018, 07:11:49 pm »
Hi, I was interested in maximizing/minimizing my window and found this thread. I realize this thread is a year old, but since no example was given and it is so simple on MS-Windows, I thought I would show the code to save anyone who needed to do it some time.

First include the windows header:

#include <windows.h>


Create your window with sf::Window or sf::RenderWindow as usual:

sf::RenderWindow window{sf::VideoMode{window_width, window_height}, "My Window Title"};


Then call the MS-Windows O/S ShowWindow() function to change the window state to maximized:

::ShowWindow(window.getSystemHandle(), SW_MAXIMIZE);


Also, there is a detailed and active discussion about adding various window state changing functionality to SFML that can be found here:
https://en.sfml-dev.org/forums/index.php?topic=23578.0

Pages: [1]