aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2018-06-02 18:26:57 +0200
committerRay <raysan5@gmail.com>2018-06-02 18:26:57 +0200
commit9688c677de8b56a78175c87f8a18af7c6bcc9d1f (patch)
tree075357f53f08d9e378c2f5531306824cfb1dae4b /src
parentc7d6a44e33b6cbebdce1c3121aa163317f85098a (diff)
downloadraylib-9688c677de8b56a78175c87f8a18af7c6bcc9d1f.tar.gz
raylib-9688c677de8b56a78175c87f8a18af7c6bcc9d1f.zip
Review window creation hints
Diffstat (limited to 'src')
-rw-r--r--src/core.c37
-rw-r--r--src/raylib.h2
2 files changed, 18 insertions, 21 deletions
diff --git a/src/core.c b/src/core.c
index 5cd9bfd4..1f9159f9 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1884,31 +1884,28 @@ static bool InitGraphicsDevice(int width, int height)
displayHeight = screenHeight;
#endif // defined(PLATFORM_WEB)
- glfwDefaultWindowHints(); // Set default windows hints
+ glfwDefaultWindowHints(); // Set default windows hints:
+ //glfwWindowHint(GLFW_RED_BITS, 8); // Framebuffer red color component bits
+ //glfwWindowHint(GLFW_GREEN_BITS, 8); // Framebuffer green color component bits
+ //glfwWindowHint(GLFW_BLUE_BITS, 8); // Framebuffer blue color component bits
+ //glfwWindowHint(GLFW_ALPHA_BITS, 8); // Framebuffer alpha color component bits
+ //glfwWindowHint(GLFW_DEPTH_BITS, 24); // Depthbuffer bits
+ //glfwWindowHint(GLFW_REFRESH_RATE, 0); // Refresh rate for fullscreen window
+ //glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); // OpenGL API to use. Alternative: GLFW_OPENGL_ES_API
+ //glfwWindowHint(GLFW_AUX_BUFFERS, 0); // Number of auxiliar buffers
// Check some Window creation flags
- if (configFlags & FLAG_WINDOW_RESIZABLE) glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window
+ if (configFlags & FLAG_WINDOW_RESIZABLE) glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window
else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable
- if (configFlags & FLAG_WINDOW_DECORATED) glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Border and buttons on Window
+ if (configFlags & FLAG_WINDOW_UNDECORATED) glfwWindowHint(GLFW_DECORATED, GL_FALSE); // Border and buttons on Window
+ else glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Decorated window
- if (configFlags & FLAG_WINDOW_TRANSPARENT)
- {
- // TODO: Enable transparent window (not ready yet on GLFW 3.2)
- }
+ if (configFlags & FLAG_WINDOW_TRANSPARENT) glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); // Transparent framebuffer
+ else glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_FALSE); // Opaque framebuffer
- if (configFlags & FLAG_MSAA_4X_HINT)
- {
- glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0
- TraceLog(LOG_INFO, "Trying to enable MSAA x4");
- }
+ if (configFlags & FLAG_MSAA_4X_HINT) glfwWindowHint(GLFW_SAMPLES, 4); // Tries to enable multisampling x4 (MSAA), default is 0
- //glfwWindowHint(GLFW_RED_BITS, 8); // Framebuffer red color component bits
- //glfwWindowHint(GLFW_DEPTH_BITS, 16); // Depthbuffer bits (24 by default)
- //glfwWindowHint(GLFW_REFRESH_RATE, 0); // Refresh rate for fullscreen window
- //glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); // Default OpenGL API to use. Alternative: GLFW_OPENGL_ES_API
- //glfwWindowHint(GLFW_AUX_BUFFERS, 0); // Number of auxiliar buffers
-
// NOTE: When asking for an OpenGL context version, most drivers provide highest supported version
// with forward compatibility to older OpenGL versions.
// For example, if using OpenGL 1.1, driver can provide a 4.3 context forward compatible.
@@ -1926,11 +1923,11 @@ static bool InitGraphicsDevice(int width, int height)
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above!
// Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE
#if defined(__APPLE__)
- glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires
+ glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires fordward compatibility
#else
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above!
#endif
- //glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
+ //glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); // Request OpenGL DEBUG context
}
if (fullscreen)
diff --git a/src/raylib.h b/src/raylib.h
index dad08ba2..a3fa1311 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -92,7 +92,7 @@
#define FLAG_SHOW_LOGO 1 // Set to show raylib logo at startup
#define FLAG_FULLSCREEN_MODE 2 // Set to run program in fullscreen
#define FLAG_WINDOW_RESIZABLE 4 // Set to allow resizable window
-#define FLAG_WINDOW_DECORATED 8 // Set to show window decoration (frame and buttons)
+#define FLAG_WINDOW_UNDECORATED 8 // Set to disable window decoration (frame and buttons)
#define FLAG_WINDOW_TRANSPARENT 16 // Set to allow transparent window
#define FLAG_MSAA_4X_HINT 32 // Set to try enabling MSAA 4X
#define FLAG_VSYNC_HINT 64 // Set to try enabling V-Sync on GPU