aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlendi <slendi@socopon.com>2024-04-02 02:35:54 +0300
committerSlendi <slendi@socopon.com>2024-04-02 02:35:54 +0300
commit5790abb09e9b958265cf3f203b1d997b9c091bb4 (patch)
tree9ff0b4347aaaa88bdc507e5f1b7d16bff5e91a77
parentbce9357ee839ac1afef23c4b37f1a855dcbc1307 (diff)
Update
Signed-off-by: Slendi <slendi@socopon.com>
-rwxr-xr-xbuild.mac.sh3
-rw-r--r--icon.pngbin0 -> 9444 bytes
-rw-r--r--icon.svg110
-rw-r--r--main.cpp16
4 files changed, 122 insertions, 7 deletions
diff --git a/build.mac.sh b/build.mac.sh
index 12b9943..21c3279 100755
--- a/build.mac.sh
+++ b/build.mac.sh
@@ -1,4 +1,5 @@
#!/bin/sh
-clang++ -O3 -std=c++20 main.cpp -o pres -I/opt/homebrew/include /opt/homebrew/lib/libraylib.a -lm -framework Cocoa -framework OpenGL -framework IOKit
+
+clang++ -O3 -std=c++20 main.cpp /opt/local/lib/libraylib.dylib -I/opt/local/include -o pres -lm -framework Cocoa -framework OpenGL -framework IOKit
diff --git a/icon.png b/icon.png
new file mode 100644
index 0000000..b85eacc
--- /dev/null
+++ b/icon.png
Binary files differ
diff --git a/icon.svg b/icon.svg
new file mode 100644
index 0000000..df5adcb
--- /dev/null
+++ b/icon.svg
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="256"
+ height="256"
+ viewBox="0 0 67.733333 67.733333"
+ version="1.1"
+ id="svg1"
+ inkscape:version="1.3.2 (091e20e, 2023-11-25)"
+ sodipodi:docname="icon.svg"
+ inkscape:export-filename="icon.png"
+ inkscape:export-xdpi="192"
+ inkscape:export-ydpi="192"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <sodipodi:namedview
+ id="namedview1"
+ pagecolor="#ffffff"
+ bordercolor="#000000"
+ borderopacity="0.25"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:document-units="mm"
+ inkscape:zoom="1.6972895"
+ inkscape:cx="135.51018"
+ inkscape:cy="144.3478"
+ inkscape:window-width="1680"
+ inkscape:window-height="997"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="layer2" />
+ <defs
+ id="defs1">
+ <linearGradient
+ id="linearGradient1"
+ inkscape:collect="always">
+ <stop
+ style="stop-color:#ff8923;stop-opacity:1;"
+ offset="0"
+ id="stop2" />
+ <stop
+ style="stop-color:#ff290e;stop-opacity:1;"
+ offset="1"
+ id="stop1" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1"
+ id="linearGradient2"
+ x1="33.866665"
+ y1="0"
+ x2="33.866665"
+ y2="67.73333"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <g
+ inkscape:label="BG"
+ inkscape:groupmode="layer"
+ id="layer1"
+ sodipodi:insensitive="true">
+ <rect
+ style="fill:url(#linearGradient2);stroke-width:0.264583"
+ id="rect1"
+ width="67.73333"
+ height="67.73333"
+ x="0"
+ y="0"
+ ry="7.4825187" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="Layer 2">
+ <g
+ id="g5"
+ transform="translate(0,-3.2132622)">
+ <rect
+ style="fill:none;stroke:#ffffff;stroke-width:2.64583;stroke-dasharray:none"
+ id="rect2"
+ width="45.362766"
+ height="35"
+ x="11.185284"
+ y="19.836943"
+ ry="3.2736025" />
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:4.7625;stroke-linecap:square;stroke-dasharray:none"
+ d="M 11.185285,20.38125 H 56.548049"
+ id="path4" />
+ <path
+ style="fill:#ffffff;stroke:none;stroke-width:2.00797;stroke-linecap:square;stroke-dasharray:none"
+ id="path5"
+ sodipodi:type="arc"
+ sodipodi:cx="33.866669"
+ sodipodi:cy="37.336945"
+ sodipodi:rx="10.015184"
+ sodipodi:ry="10.015184"
+ sodipodi:start="0"
+ sodipodi:end="4.902347"
+ sodipodi:arc-type="slice"
+ d="m 43.881853,37.336945 a 10.015184,10.015184 0 0 1 -6.626107,9.424334 10.015184,10.015184 0 0 1 -11.110576,-3.04606 10.015184,10.015184 0 0 1 -0.893394,-11.48587 10.015184,10.015184 0 0 1 10.505936,-4.727437 l -1.891043,9.835033 z" />
+ </g>
+ </g>
+</svg>
diff --git a/main.cpp b/main.cpp
index 2cc063f..67ef26a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -61,14 +61,18 @@ public:
SetTargetFPS(30);
if (m_config.fullscreen) {
- w = GetMonitorWidth(GetCurrentMonitor());
- h = GetMonitorHeight(GetCurrentMonitor());
+ w = GetMonitorWidth(1);
+ h = GetMonitorHeight(1);
}
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_MSAA_4X_HINT);
InitWindow(w, h, "Presentation");
SetTargetFPS(30);
+ SetWindowMonitor(1);
+
+ SetWindowIcon(LoadImage("icon.png"));
+
auto time_begin = std::chrono::high_resolution_clock::now();
m_font = LoadFontEx(m_config.font_path.c_str(), 128, nullptr, 0x2030);
auto time_end = std::chrono::high_resolution_clock::now();
@@ -81,8 +85,8 @@ public:
SetTextureFilter(m_font.texture, TEXTURE_FILTER_TRILINEAR);
- int display_width = GetMonitorWidth(GetCurrentMonitor());
- int display_height = GetMonitorHeight(GetCurrentMonitor());
+ int display_width = GetMonitorWidth(1);
+ int display_height = GetMonitorHeight(1);
if (m_config.fullscreen)
ToggleFullscreen();
@@ -100,8 +104,8 @@ public:
HideCursor();
while (!WindowShouldClose()) {
float font_scale =
- (GetMonitorWidth(GetCurrentMonitor()) / (float)GetScreenWidth() +
- GetMonitorHeight(GetCurrentMonitor()) / (float)GetScreenHeight()) /
+ (GetMonitorWidth(1) / (float)GetScreenWidth() +
+ GetMonitorHeight(1) / (float)GetScreenHeight()) /
2.0f;
if (IsKeyPressed(KEY_F))