summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2017-09-08 09:35:54 +0200
committerraysan5 <[email protected]>2017-09-08 09:35:54 +0200
commitf3f6d3fd8ee5145a9ac8d66ebccc1d75e3e73dff (patch)
treed57ca735ea0bec5492d5b99e5755299bcf20138c /src/core.c
parentfb334e2fd11ade79377a2d95a83000763c047975 (diff)
downloadraylib-f3f6d3fd8ee5145a9ac8d66ebccc1d75e3e73dff.tar.gz
raylib-f3f6d3fd8ee5145a9ac8d66ebccc1d75e3e73dff.zip
Added new functions
SetWindowTitle() GetExtension()
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 78c0a7ef..586d1137 100644
--- a/src/core.c
+++ b/src/core.c
@@ -659,6 +659,14 @@ void SetWindowIcon(Image image)
#endif
}
+// Set title for window (only PLATFORM_DESKTOP)
+void SetWindowTitle(const char *title)
+{
+#if defined(PLATFORM_DESKTOP)
+ glfwSetWindowTitle(window, title);
+#endif
+}
+
// Set window position on screen (windowed mode)
void SetWindowPosition(int x, int y)
{
@@ -1152,6 +1160,16 @@ bool IsFileExtension(const char *fileName, const char *ext)
return result;
}
+// Get the extension for a filename
+const char *GetExtension(const char *fileName)
+{
+ const char *dot = strrchr(fileName, '.');
+
+ if (!dot || dot == fileName) return "";
+
+ return (dot + 1);
+}
+
// Get directory for a given fileName (with path)
const char *GetDirectoryPath(const char *fileName)
{