Compare commits
No commits in common. "53a148d9798e17b19f146555ac53d9a38c13ceb7" and "b9d7d9ba7e8c68b1ae33a5f9cff5e5484fbbe44c" have entirely different histories.
53a148d979
...
b9d7d9ba7e
6 changed files with 470 additions and 903 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,10 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
# Currently not cross compiling for windows and darwin
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# This is supposed to use Karl Zylinski's odin-c-bindgen
|
|
||||||
# https://github.com/karl-zylinski/odin-c-bindgen
|
|
||||||
odin-c-bindgen bindgen.sjson
|
|
||||||
rm -f ../raygui.odin
|
|
||||||
cp bindgen_output/raygui.odin ../
|
|
||||||
rm -r bindgen_output
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
inputs = [
|
|
||||||
"raygui.h"
|
|
||||||
]
|
|
||||||
|
|
||||||
imports_file = "imports.odin"
|
|
||||||
|
|
||||||
output_folder = "bindgen_output"
|
|
||||||
|
|
||||||
package_name = "raylib"
|
|
||||||
|
|
||||||
clang_include_paths = [
|
|
||||||
"../raylib/src"
|
|
||||||
]
|
|
||||||
|
|
||||||
procedure_type_overrides = {
|
|
||||||
"GuiSetStyle.control" = "GuiControl"
|
|
||||||
"GuiGetStyle.control" = "GuiControl"
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
RAYGUI_SHARED :: #config(RAYGUI_SHARED, false)
|
|
||||||
RAYGUI_WASM_LIB :: #config(RAYGUI_WASM_LIB, "wasm/libraygui.a")
|
|
||||||
|
|
||||||
when ODIN_OS == .Windows {
|
|
||||||
foreign import lib {
|
|
||||||
"windows/rayguidll.lib" when RAYGUI_SHARED else "windows/raygui.lib",
|
|
||||||
}
|
|
||||||
} else when ODIN_OS == .Linux {
|
|
||||||
foreign import lib {
|
|
||||||
"linux/libraygui.so" when RAYGUI_SHARED else "linux/libraygui.a",
|
|
||||||
}
|
|
||||||
} else when ODIN_OS == .Darwin {
|
|
||||||
when ODIN_ARCH == .arm64 {
|
|
||||||
foreign import lib {
|
|
||||||
"macos/libraygui-arm64.dylib" when RAYGUI_SHARED else "macos/libraygui-arm64.a",
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreign import lib {
|
|
||||||
"macos/libraygui.dylib" when RAYGUI_SHARED else "macos/libraygui.a",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
|
|
||||||
foreign import lib {
|
|
||||||
RAYGUI_WASM_LIB,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreign import lib "system:raygui"
|
|
||||||
}
|
|
||||||
|
|
@ -1091,7 +1091,7 @@ program_render_ui_and_handle_focus :: proc(ctx: ^ui.Context, focus_element_id: u
|
||||||
// TODO (synthas): implement keeping the rectangle within screen borders
|
// TODO (synthas): implement keeping the rectangle within screen borders
|
||||||
tooltip_position = rl.GetMousePosition()
|
tooltip_position = rl.GetMousePosition()
|
||||||
}
|
}
|
||||||
if rl.GuiButton(area, element.label) == 1 {
|
if rl.GuiButton(area, element.label) {
|
||||||
if element.data == nil do break
|
if element.data == nil do break
|
||||||
data := cast(^UiElementData_Button)element.data
|
data := cast(^UiElementData_Button)element.data
|
||||||
switch data.type {
|
switch data.type {
|
||||||
|
|
@ -1199,7 +1199,7 @@ program_render_ui_and_handle_focus :: proc(ctx: ^ui.Context, focus_element_id: u
|
||||||
}
|
}
|
||||||
case .InputText:
|
case .InputText:
|
||||||
data := cast(^UiElementData_TextInput)element.data
|
data := cast(^UiElementData_TextInput)element.data
|
||||||
if rl.GuiTextBox(area, data.str, i32(program.font_style.size), focus_element_id == element.id) == 1 {
|
if rl.GuiTextBox(area, data.str, i32(program.font_style.size), focus_element_id == element.id) {
|
||||||
focus_element_id = element.id
|
focus_element_id = element.id
|
||||||
}
|
}
|
||||||
case .Label:
|
case .Label:
|
||||||
|
|
|
||||||
|
|
@ -4,20 +4,12 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
|
||||||
<title>Transformation Visualizer</title>
|
<title>Odin + Raylib on the web</title>
|
||||||
<meta name="title" content="Transformation Visualizer">
|
<meta name="title" content="Odin + Raylib on the web">
|
||||||
<meta name="description" content="Math visualization tool">
|
<meta name="description" content="Make games using Odin + Raylib that work in the browser">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
* {
|
|
||||||
vertical-align: baseline;
|
|
||||||
border: 0 none;
|
|
||||||
outline: 0;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
body {
|
body {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
@ -35,11 +27,6 @@
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
@ -74,16 +61,17 @@
|
||||||
e._start();
|
e._start();
|
||||||
e.main_start();
|
e.main_start();
|
||||||
|
|
||||||
function send_resize() {
|
function send_resize() {
|
||||||
var canvas = document.getElementById('canvas');
|
var canvas = document.getElementById('canvas');
|
||||||
canvas.width = document.documentElement.clientWidth;
|
canvas.width = document.documentElement.clientWidth;
|
||||||
canvas.height = document.documentElement.clientHeight;
|
canvas.height = document.documentElement.clientHeight;
|
||||||
e.web_window_size_changed(canvas.width, canvas.height);
|
console.log(canvas.width, canvas.height);
|
||||||
}
|
e.web_window_size_changed(canvas.width, canvas.height);
|
||||||
|
}
|
||||||
|
|
||||||
window.addEventListener('resize', function(event) {
|
window.addEventListener('resize', function(event) {
|
||||||
send_resize();
|
send_resize();
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
send_resize();
|
send_resize();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue