diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-13 15:04:23 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-13 15:04:23 +0100 |
| commit | 6a88dc322acfd54c55ed7dceebdeaa5ce18ce416 (patch) | |
| tree | 1bee3c6bd331cf7427451de9476564a9f7b030c9 /core/sys | |
| parent | 6b464e35586ebc8a8dadece60f188817f875da85 (diff) | |
Declaration grouping uses braces rather than parentheses
Diffstat (limited to 'core/sys')
| -rw-r--r-- | core/sys/wgl.odin | 16 | ||||
| -rw-r--r-- | core/sys/windows.odin | 47 |
2 files changed, 32 insertions, 31 deletions
diff --git a/core/sys/wgl.odin b/core/sys/wgl.odin index a668790d5..c02bd3805 100644 --- a/core/sys/wgl.odin +++ b/core/sys/wgl.odin @@ -1,7 +1,7 @@ foreign_system_library "opengl32.lib" when ODIN_OS == "windows"; import . "windows.odin"; -const ( +const { CONTEXT_MAJOR_VERSION_ARB = 0x2091; CONTEXT_MINOR_VERSION_ARB = 0x2092; CONTEXT_FLAGS_ARB = 0x2094; @@ -9,9 +9,9 @@ const ( CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x0002; CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001; CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002; -) +} -type ( +type { Hglrc Handle; ColorRef u32; @@ -53,21 +53,21 @@ type ( cell_inc_x: f32, cell_inc_y: f32, } -) +} -type ( +type { CreateContextAttribsARBType proc(hdc: Hdc, h_share_context: rawptr, attribList: ^i32) -> Hglrc; ChoosePixelFormatARBType proc(hdc: Hdc, attrib_i_list: ^i32, attrib_f_list: ^f32, max_formats: u32, formats: ^i32, num_formats : ^u32) -> Bool #cc_c; SwapIntervalEXTType proc(interval: i32) -> bool #cc_c; GetExtensionsStringARBType proc(Hdc) -> ^u8 #cc_c; -) +} -var ( +var { create_context_attribs_arb: CreateContextAttribsARBType; choose_pixel_format_arb: ChoosePixelFormatARBType; swap_interval_ext: SwapIntervalEXTType; get_extensions_string_arb: GetExtensionsStringARBType; -) +} foreign opengl32 { diff --git a/core/sys/windows.odin b/core/sys/windows.odin index a6b758e5c..91ec9bc1b 100644 --- a/core/sys/windows.odin +++ b/core/sys/windows.odin @@ -1,12 +1,12 @@ -foreign_system_library ( +foreign_system_library { "kernel32.lib" when ODIN_OS == "windows"; "user32.lib" when ODIN_OS == "windows"; "gdi32.lib" when ODIN_OS == "windows"; "winmm.lib" when ODIN_OS == "windows"; "shell32.lib" when ODIN_OS == "windows"; -) +} -type ( +type { Handle rawptr; Hwnd Handle; Hdc Handle; @@ -21,10 +21,14 @@ type ( Wparam uint; Lparam int; Lresult int; - Bool i32; WndProc proc(Hwnd, u32, Wparam, Lparam) -> Lresult #cc_c; +} -) +type Bool i32; +const { + FALSE: Bool = 0; + TRUE = 1; +} type Point struct #ordered { x, y: i32, @@ -147,22 +151,19 @@ type PixelFormatDescriptor struct #ordered { type Proc proc() #cc_c; -const ( +const { MAPVK_VK_TO_CHAR = 2; MAPVK_VK_TO_VSC = 0; MAPVK_VSC_TO_VK = 1; MAPVK_VSC_TO_VK_EX = 3; -) +} const INVALID_HANDLE = Handle(~int(0)); -const ( - FALSE: Bool = 0; - TRUE = 1; -) -const ( + +const { CS_VREDRAW = 0x0001; CS_HREDRAW = 0x0002; CS_OWNDC = 0x0020; @@ -220,7 +221,7 @@ const ( SM_CYSCREEN = 1; SW_SHOW = 5; -) +} const COLOR_BACKGROUND = Hbrush(int(1)); @@ -234,24 +235,24 @@ const BI_RGB = 0; const DIB_RGB_COLORS = 0x00; const SRCCOPY: u32 = 0x00cc0020; -const ( +const { MONITOR_DEFAULTTONULL = 0x00000000; MONITOR_DEFAULTTOPRIMARY = 0x00000001; MONITOR_DEFAULTTONEAREST = 0x00000002; -) -const ( +} +const { SWP_FRAMECHANGED = 0x0020; SWP_NOOWNERZORDER = 0x0200; SWP_NOZORDER = 0x0004; SWP_NOSIZE = 0x0001; SWP_NOMOVE = 0x0002; -) +} // Windows OpenGL -const ( +const { PFD_TYPE_RGBA = 0; PFD_TYPE_COLORINDEX = 1; PFD_MAIN_PLANE = 0; @@ -273,15 +274,15 @@ const ( PFD_DEPTH_DONTCARE = 0x20000000; PFD_DOUBLEBUFFER_DONTCARE = 0x40000000; PFD_STEREO_DONTCARE = 0x80000000; -) +} type GET_FILEEX_INFO_LEVELS i32; -const ( +const { GetFileExInfoStandard: GET_FILEEX_INFO_LEVELS = 0; GetFileExMaxInfoLevel = 1; -) +} foreign kernel32 { proc get_last_error () -> i32 #link_name "GetLastError"; @@ -462,7 +463,7 @@ proc is_key_down(key: KeyCode) -> bool #inline { return get_async_key_state(i32( -const ( +const { MAX_PATH = 0x00000104; HANDLE_FLAG_INHERIT = 1; @@ -512,7 +513,7 @@ const ( FILE_TYPE_DISK = 0x0001; FILE_TYPE_CHAR = 0x0002; FILE_TYPE_PIPE = 0x0003; -) +} type MonitorInfo struct #ordered { |