Some enums values have been renamed to be more consistent and also provide a more detailed description:
- ShaderLocationIndex: LOC_VERTEX_POSITION -> SHADER_SHADER_LOC_VERTEX_POSITION
- ShaderUniformDataType: UNIFORM_VEC2 -> SHADER_UNIFORM_VEC2
- MaterialMapType: MAP_ALBEDO -> MATERIAL_MAP_ALBEDO
- PixelFormat: UNCOMPRESSED_GRAYSCALE -> PIXELFORMAT_UNCOMPRESSED_GRAYSCALE
* Always try to set vsync.
Use the internal monitor function to correctly get the display for windows.
* Modified how fullscreen gets toggled.
- Removed the unsetting and setting of the resize callback function. Instead of that I moved the fullscreen flag setting into a more correct place before setting the fullscreen so that this flag can be used in the callback.
- In the resize callback now window size is only set when it is not fullscreen resulting in preserving the window size.
- When going fullscreen the larges resolution is used so that there are no problems of the type when you minimize the window you cannot use anything else in your desktop because the resolution might be too low. If a low res effect is desired one should use render texture (this is the approach all game engines use).
* Set correct return to window in case of fail to get monitor.
* Set the refresh rate on the mode.
* Made changes based on review from @raysan5
Co-authored-by: Jeffery Myers <JeffM2501@gmail.com>
* Disabling WindowSizeCallback around fullscreen toggle.
#1294 fixed the issue that toggle fullscreen changes the screen size because of the WindowSizeCallback. The proposed edit by @raysan5 was to comment out WindowSizeCallback which I essentially simplified to disable the callback around the set window monitor functions.
The developers using the ToggleFullscreen function should be aware that they need to size the screen correctly on that same frame. Otherwise they should check if fullscreen and size properly using the GetMonitorWidth and GetMonitorHeight functions.
* Update core.c
Fix issue from merge
This solves issue #1322 which in my opinion was prematurely closed. As the monitor resolution is expected to be the maximum that the monitor supports. My change is that as per GLFW documentation you can get all current video modes sorted by max resolution. When you toggle fullscreen the first video mode returned would be the current screen resolution setup but that doesn't help if you want to know the maximum supported.
* Added a new utility function to get the current monitor.
Some of the other functions rely on passing on a monitor id but we only have a function for querying the count of monitors available.
* Updated the comment to correctly reflect the function action
This monitor should even probably be passed as an id instead to make it more consistent with the rest of the API but this would break existing applications so I am hesitant to change the function signature directly.