Compare commits

..
2 Commits
Author SHA1 Message Date
talksik 78acace2d3 adjust for macos experience 2026-10-03 15:04:18 -07:00
talksik dae6969876 build for macos 2026-10-03 15:03:09 -07:00
3 changed files with 21 additions and 7 deletions
+4 -3
View File
@@ -1,8 +1,9 @@
CC = cc
CFLAGS = -g -Wall -Iinclude
CFLAGS = -g -Wall -Iinclude -I/opt/homebrew/include
SOURCES = src/main.c src/window_state.c
OBJECTS = src/main.o src/window_state.o
LDFLAGS = -lraylib -lm -lsqlite3
LDFLAGS = -L/opt/homebrew/lib
LDLIBS = -lraylib -lm -lsqlite3
HEADERS = \
include/raygui.h include/common.h include/window_state.h
@@ -16,7 +17,7 @@ BINDIR := $(PREFIX)/bin
# $(CC) $(CFLAGS) -c $< -o $@
adhd: src/main.o src/window_state.o
$(CC) $(CFLAGS) src/main.o src/window_state.o -o $@ $(LDFLAGS)
$(CC) $(CFLAGS) src/main.o src/window_state.o -o $@ $(LDFLAGS) $(LDLIBS)
src/main.o: src/main.c $(HEADERS)
$(CC) -c $(CFLAGS) src/main.c -o $@
+16 -4
View File
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdbool.h>
#define RAYGUI_IMPLEMENTATION
#include <raygui.h>
@@ -18,12 +19,23 @@
void switch_mode(Mode mode) {
set_mode(mode);
int monitor = GetCurrentMonitor();
switch (mode) {
case WINDOW:
SetWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT);
SetWindowState(FLAG_WINDOW_TRANSPARENT | FLAG_WINDOW_UNDECORATED);
SetWindowOpacity(1);
// cneter in screen
SetWindowPosition((GetMonitorWidth(monitor) / 2) - (WINDOW_WIDTH / 2), (GetMonitorHeight(monitor) / 2) - (WINDOW_HEIGHT / 2));
break;
case OVERLAY:
SetWindowOpacity(0.5);
SetWindowSize(OVERLAY_WIDTH, OVERLAY_HEIGHT);
SetWindowState(FLAG_WINDOW_TRANSPARENT | FLAG_WINDOW_UNDECORATED | FLAG_WINDOW_TOPMOST);
// bottom right of screen
SetWindowPosition(GetMonitorWidth(monitor) - OVERLAY_WIDTH, GetMonitorHeight(monitor) - OVERLAY_HEIGHT);
break;
default:
break;
@@ -108,11 +120,10 @@ void draw_graph(int x, int y) {
GuiDisableTooltip();
}
bool edit_mode = false;
bool edit_mode = true;
void render_window() {
ClearBackground(RAYWHITE);
DrawFPS(WINDOW_WIDTH - 50, 10);
Rectangle text_box_rect = {(WINDOW_WIDTH / 2) - 200, (WINDOW_HEIGHT / 2) - 200, 400, 50};
Vector2 mouse_pos = GetMousePosition();
@@ -138,9 +149,8 @@ void render_window() {
void render_overlay() {
ClearBackground(BLANK);
DrawFPS(OVERLAY_WIDTH - 50, 10);
const Rectangle button_rect = {OVERLAY_WIDTH - 100, 10, 100, 25};
const Rectangle button_rect = {OVERLAY_WIDTH - 100, OVERLAY_HEIGHT - 30, 100, 25};
int active = 0;
if (GuiToggleSlider(button_rect, "Toggle mode", &active)) {
@@ -150,6 +160,7 @@ void render_overlay() {
GuiSetStyle(DEFAULT, TEXT_SIZE, 75);
GuiSetStyle(DEFAULT, TEXT_WRAP_MODE, TEXT_WRAP_CHAR);
GuiSetStyle(LABEL, TEXT_ALIGNMENT, TEXT_ALIGN_CENTER);
GuiSetStyle(LABEL, TEXT_COLOR_NORMAL, ColorToInt(GOLD));
GuiLabel((Rectangle){0, 0, OVERLAY_WIDTH, OVERLAY_HEIGHT}, get_intention());
GuiSetStyle(DEFAULT, TEXT_WRAP_MODE, 0);
}
@@ -163,6 +174,7 @@ int main(int argc, char *argv[]) {
printf("Welcome to Flowy.adhd\n");
SetConfigFlags(FLAG_WINDOW_TRANSPARENT | FLAG_WINDOW_UNDECORATED);
InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, "Flowy.adhd");
while (!WindowShouldClose()) {
+1
View File
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#include <sqlite3.h>