aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-14 12:00:04 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-14 12:00:04 +0100
commita60e6bedd963b9de4207e5bf8dba13e5c596dd1b (patch)
tree4db37211e35de8f51f329909e8b181fad01ca089 /code
parent1147e17c134da1d5bb93d0754888ca1d0271a0f4 (diff)
Begin work on modules - No codegen!!!
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin5
-rw-r--r--code/file.odin2
-rw-r--r--code/print.odin6
-rw-r--r--code/runtime.odin8
-rw-r--r--code/win32.odin37
5 files changed, 32 insertions, 26 deletions
diff --git a/code/demo.odin b/code/demo.odin
index b15888012..24da86658 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -1,4 +1,7 @@
-#load "basic.odin"
+// #load "basic.odin"
+#import "runtime.odin"
+#import "print.odin"
+
main :: proc() {
println("% % % %", "Hellope", true, 6.28, {4}int{1, 2, 3, 4})
diff --git a/code/file.odin b/code/file.odin
index a424e6d73..816672fdf 100644
--- a/code/file.odin
+++ b/code/file.odin
@@ -1,4 +1,4 @@
-#load "win32.odin"
+#import "win32.odin"
File :: type struct {
Handle :: type HANDLE
diff --git a/code/print.odin b/code/print.odin
index 01a972ebb..6095730a6 100644
--- a/code/print.odin
+++ b/code/print.odin
@@ -1,6 +1,6 @@
-#load "runtime.odin"
-#load "win32.odin"
-#load "file.odin"
+#import "runtime.odin"
+#import "win32.odin"
+#import "file.odin"
print_byte_buffer :: proc(buf: ^[]byte, b: []byte) {
if buf.count < buf.capacity {
diff --git a/code/runtime.odin b/code/runtime.odin
index 4e79039d1..89d3f7861 100644
--- a/code/runtime.odin
+++ b/code/runtime.odin
@@ -1,5 +1,9 @@
-#load "win32.odin"
-#load "print.odin"
+#global_scope
+
+// TODO(bill): Remove #import in runtime.odin
+#import "win32.odin"
+#import "file.odin"
+#import "print.odin"
// IMPORTANT NOTE(bill): Do not change the order of any of this data
// The compiler relies upon this _exact_ order
diff --git a/code/win32.odin b/code/win32.odin
index 5083d6d47..2bc927ecb 100644
--- a/code/win32.odin
+++ b/code/win32.odin
@@ -1,6 +1,24 @@
#foreign_system_library "user32"
#foreign_system_library "gdi32"
+HANDLE :: type rawptr
+HWND :: type HANDLE
+HDC :: type HANDLE
+HINSTANCE :: type HANDLE
+HICON :: type HANDLE
+HCURSOR :: type HANDLE
+HMENU :: type HANDLE
+HBRUSH :: type HANDLE
+WPARAM :: type uint
+LPARAM :: type int
+LRESULT :: type int
+ATOM :: type i16
+BOOL :: type i32
+POINT :: type struct { x, y: i32 }
+WNDPROC :: type proc(hwnd: HWND, msg: u32, wparam: WPARAM, lparam: LPARAM) -> LRESULT
+
+INVALID_HANDLE_VALUE :: (-1 as int) as HANDLE
+
CS_VREDRAW :: 1
CS_HREDRAW :: 2
CW_USEDEFAULT :: 0x80000000
@@ -23,25 +41,6 @@ PM_REMOVE :: 1
COLOR_BACKGROUND :: 1 as HBRUSH
-HANDLE :: type rawptr
-HWND :: type HANDLE
-HDC :: type HANDLE
-HINSTANCE :: type HANDLE
-HICON :: type HANDLE
-HCURSOR :: type HANDLE
-HMENU :: type HANDLE
-HBRUSH :: type HANDLE
-WPARAM :: type uint
-LPARAM :: type int
-LRESULT :: type int
-ATOM :: type i16
-BOOL :: type i32
-POINT :: type struct { x, y: i32 }
-
-INVALID_HANDLE_VALUE :: (-1 as int) as HANDLE
-
-WNDPROC :: type proc(hwnd: HWND, msg: u32, wparam: WPARAM, lparam: LPARAM) -> LRESULT
-
WNDCLASSEXA :: struct #ordered {
size, style: u32
wnd_proc: WNDPROC