mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 20:28:15 +00:00
:: style procedure declarations; remove old parsing code
This commit is contained in:
+16
-16
@@ -66,20 +66,20 @@ GetExtensionsStringARBType :: proc(Hdc) -> ^u8 #cc_c;
|
||||
|
||||
|
||||
foreign opengl32 {
|
||||
proc create_context (hdc: Hdc) -> Hglrc #link_name "wglCreateContext";
|
||||
proc make_current (hdc: Hdc, hglrc: Hglrc) -> Bool #link_name "wglMakeCurrent";
|
||||
proc get_proc_address (c_str: ^u8) -> Proc #link_name "wglGetProcAddress";
|
||||
proc delete_context (hglrc: Hglrc) -> Bool #link_name "wglDeleteContext";
|
||||
proc copy_context (src, dst: Hglrc, mask: u32) -> Bool #link_name "wglCopyContext";
|
||||
proc create_layer_context (hdc: Hdc, layer_plane: i32) -> Hglrc #link_name "wglCreateLayerContext";
|
||||
proc describe_layer_plane (hdc: Hdc, pixel_format, layer_plane: i32, bytes: u32, pd: ^LayerPlaneDescriptor) -> Bool #link_name "wglDescribeLayerPlane";
|
||||
proc get_current_context () -> Hglrc #link_name "wglGetCurrentContext";
|
||||
proc get_current_dc () -> Hdc #link_name "wglGetCurrentDC";
|
||||
proc get_layer_palette_entries(hdc: Hdc, layer_plane, start, entries: i32, cr: ^ColorRef) -> i32 #link_name "wglGetLayerPaletteEntries";
|
||||
proc realize_layer_palette (hdc: Hdc, layer_plane: i32, realize: Bool) -> Bool #link_name "wglRealizeLayerPalette";
|
||||
proc set_layer_palette_entries(hdc: Hdc, layer_plane, start, entries: i32, cr: ^ColorRef) -> i32 #link_name "wglSetLayerPaletteEntries";
|
||||
proc share_lists (hglrc1, hglrc2: Hglrc) -> Bool #link_name "wglShareLists";
|
||||
proc swap_layer_buffers (hdc: Hdc, planes: u32) -> Bool #link_name "wglSwapLayerBuffers";
|
||||
proc use_font_bitmaps (hdc: Hdc, first, count, list_base: u32) -> Bool #link_name "wglUseFontBitmaps";
|
||||
proc use_font_outlines (hdc: Hdc, first, count, list_base: u32, deviation, extrusion: f32, format: i32, gmf: ^Glyph_MetricsFloat) -> Bool #link_name "wglUseFontOutlines";
|
||||
create_context :: proc(hdc: Hdc) -> Hglrc #link_name "wglCreateContext" ---;
|
||||
make_current :: proc(hdc: Hdc, hglrc: Hglrc) -> Bool #link_name "wglMakeCurrent" ---;
|
||||
get_proc_address :: proc(c_str: ^u8) -> Proc #link_name "wglGetProcAddress" ---;
|
||||
delete_context :: proc(hglrc: Hglrc) -> Bool #link_name "wglDeleteContext" ---;
|
||||
copy_context :: proc(src, dst: Hglrc, mask: u32) -> Bool #link_name "wglCopyContext" ---;
|
||||
create_layer_context :: proc(hdc: Hdc, layer_plane: i32) -> Hglrc #link_name "wglCreateLayerContext" ---;
|
||||
describe_layer_plane :: proc(hdc: Hdc, pixel_format, layer_plane: i32, bytes: u32, pd: ^LayerPlaneDescriptor) -> Bool #link_name "wglDescribeLayerPlane" ---;
|
||||
get_current_context :: proc() -> Hglrc #link_name "wglGetCurrentContext" ---;
|
||||
get_current_dc :: proc() -> Hdc #link_name "wglGetCurrentDC" ---;
|
||||
get_layer_palette_entries :: proc(hdc: Hdc, layer_plane, start, entries: i32, cr: ^ColorRef) -> i32 #link_name "wglGetLayerPaletteEntries" ---;
|
||||
realize_layer_palette :: proc(hdc: Hdc, layer_plane: i32, realize: Bool) -> Bool #link_name "wglRealizeLayerPalette" ---;
|
||||
set_layer_palette_entries :: proc(hdc: Hdc, layer_plane, start, entries: i32, cr: ^ColorRef) -> i32 #link_name "wglSetLayerPaletteEntries" ---;
|
||||
share_lists :: proc(hglrc1, hglrc2: Hglrc) -> Bool #link_name "wglShareLists" ---;
|
||||
swap_layer_buffers :: proc(hdc: Hdc, planes: u32) -> Bool #link_name "wglSwapLayerBuffers" ---;
|
||||
use_font_bitmaps :: proc(hdc: Hdc, first, count, list_base: u32) -> Bool #link_name "wglUseFontBitmaps" ---;
|
||||
use_font_outlines :: proc(hdc: Hdc, first, count, list_base: u32, deviation, extrusion: f32, format: i32, gmf: ^Glyph_MetricsFloat) -> Bool #link_name "wglUseFontOutlines" ---;
|
||||
}
|
||||
|
||||
+111
-111
@@ -272,180 +272,180 @@ GetFileExMaxInfoLevel: GET_FILEEX_INFO_LEVELS : 1;
|
||||
|
||||
|
||||
foreign kernel32 {
|
||||
proc get_last_error () -> i32 #cc_std #link_name "GetLastError";
|
||||
proc exit_process (exit_code: u32) #cc_std #link_name "ExitProcess";
|
||||
proc get_module_handle_a(module_name: ^u8) -> Hinstance #cc_std #link_name "GetModuleHandleA";
|
||||
proc sleep(ms: i32) -> i32 #cc_std #link_name "Sleep";
|
||||
proc query_performance_frequency(result: ^i64) -> i32 #cc_std #link_name "QueryPerformanceFrequency";
|
||||
proc query_performance_counter (result: ^i64) -> i32 #cc_std #link_name "QueryPerformanceCounter";
|
||||
proc output_debug_string_a(c_str: ^u8) #cc_std #link_name "OutputDebugStringA";
|
||||
get_last_error :: proc() -> i32 #cc_std #link_name "GetLastError" ---;
|
||||
exit_process :: proc(exit_code: u32) #cc_std #link_name "ExitProcess" ---;
|
||||
get_module_handle_a :: proc(module_name: ^u8) -> Hinstance #cc_std #link_name "GetModuleHandleA" ---;
|
||||
sleep :: proc(ms: i32) -> i32 #cc_std #link_name "Sleep" ---;
|
||||
query_performance_frequency :: proc(result: ^i64) -> i32 #cc_std #link_name "QueryPerformanceFrequency" ---;
|
||||
query_performance_counter :: proc(result: ^i64) -> i32 #cc_std #link_name "QueryPerformanceCounter" ---;
|
||||
output_debug_string_a :: proc(c_str: ^u8) #cc_std #link_name "OutputDebugStringA" ---;
|
||||
|
||||
proc get_command_line_a () -> ^u8 #cc_std #link_name "GetCommandLineA";
|
||||
proc get_command_line_w () -> ^u16 #cc_std #link_name "GetCommandLineW";
|
||||
proc get_system_metrics (index: i32) -> i32 #cc_std #link_name "GetSystemMetrics";
|
||||
proc get_current_thread_id () -> u32 #cc_std #link_name "GetCurrentThreadId";
|
||||
get_command_line_a :: proc() -> ^u8 #cc_std #link_name "GetCommandLineA" ---;
|
||||
get_command_line_w :: proc() -> ^u16 #cc_std #link_name "GetCommandLineW" ---;
|
||||
get_system_metrics :: proc(index: i32) -> i32 #cc_std #link_name "GetSystemMetrics" ---;
|
||||
get_current_thread_id :: proc() -> u32 #cc_std #link_name "GetCurrentThreadId" ---;
|
||||
|
||||
proc get_system_time_as_file_time(system_time_as_file_time: ^Filetime) #cc_std #link_name "GetSystemTimeAsFileTime";
|
||||
proc file_time_to_local_file_time(file_time: ^Filetime, local_file_time: ^Filetime) -> Bool #cc_std #link_name "FileTimeToLocalFileTime";
|
||||
proc file_time_to_system_time (file_time: ^Filetime, system_time: ^Systemtime) -> Bool #cc_std #link_name "FileTimeToSystemTime";
|
||||
proc system_time_to_file_time (system_time: ^Systemtime, file_time: ^Filetime) -> Bool #cc_std #link_name "SystemTimeToFileTime";
|
||||
get_system_time_as_file_time :: proc(system_time_as_file_time: ^Filetime) #cc_std #link_name "GetSystemTimeAsFileTime" ---;
|
||||
file_time_to_local_file_time :: proc(file_time: ^Filetime, local_file_time: ^Filetime) -> Bool #cc_std #link_name "FileTimeToLocalFileTime" ---;
|
||||
file_time_to_system_time :: proc(file_time: ^Filetime, system_time: ^Systemtime) -> Bool #cc_std #link_name "FileTimeToSystemTime" ---;
|
||||
system_time_to_file_time :: proc(system_time: ^Systemtime, file_time: ^Filetime) -> Bool #cc_std #link_name "SystemTimeToFileTime" ---;
|
||||
|
||||
proc close_handle (h: Handle) -> i32 #cc_std #link_name "CloseHandle";
|
||||
proc get_std_handle(h: i32) -> Handle #cc_std #link_name "GetStdHandle";
|
||||
proc create_file_a (filename: ^u8, desired_access, share_mode: u32,
|
||||
security: rawptr,
|
||||
creation, flags_and_attribs: u32, template_file: Handle) -> Handle #cc_std #link_name "CreateFileA";
|
||||
proc read_file (h: Handle, buf: rawptr, to_read: u32, bytes_read: ^i32, overlapped: rawptr) -> Bool #cc_std #link_name "ReadFile";
|
||||
proc write_file(h: Handle, buf: rawptr, len: i32, written_result: ^i32, overlapped: rawptr) -> Bool #cc_std #link_name "WriteFile";
|
||||
close_handle :: proc(h: Handle) -> i32 #cc_std #link_name "CloseHandle" ---;
|
||||
get_std_handle :: proc(h: i32) -> Handle #cc_std #link_name "GetStdHandle" ---;
|
||||
create_file_a :: proc(filename: ^u8, desired_access, share_mode: u32,
|
||||
security: rawptr,
|
||||
creation, flags_and_attribs: u32, template_file: Handle) -> Handle #cc_std #link_name "CreateFileA" ---;
|
||||
read_file :: proc(h: Handle, buf: rawptr, to_read: u32, bytes_read: ^i32, overlapped: rawptr) -> Bool #cc_std #link_name "ReadFile" ---;
|
||||
write_file :: proc(h: Handle, buf: rawptr, len: i32, written_result: ^i32, overlapped: rawptr) -> Bool #cc_std #link_name "WriteFile" ---;
|
||||
|
||||
proc get_file_size_ex (file_handle: Handle, file_size: ^i64) -> Bool #cc_std #link_name "GetFileSizeEx";
|
||||
proc get_file_attributes_a (filename: ^u8) -> u32 #cc_std #link_name "GetFileAttributesA";
|
||||
proc get_file_attributes_ex_a (filename: ^u8, info_level_id: GET_FILEEX_INFO_LEVELS, file_info: rawptr) -> Bool #cc_std #link_name "GetFileAttributesExA";
|
||||
proc get_file_information_by_handle(file_handle: Handle, file_info: ^ByHandleFileInformation) -> Bool #cc_std #link_name "GetFileInformationByHandle";
|
||||
get_file_size_ex :: proc(file_handle: Handle, file_size: ^i64) -> Bool #cc_std #link_name "GetFileSizeEx" ---;
|
||||
get_file_attributes_a :: proc(filename: ^u8) -> u32 #cc_std #link_name "GetFileAttributesA" ---;
|
||||
get_file_attributes_ex_a :: proc(filename: ^u8, info_level_id: GET_FILEEX_INFO_LEVELS, file_info: rawptr) -> Bool #cc_std #link_name "GetFileAttributesExA" ---;
|
||||
get_file_information_by_handle :: proc(file_handle: Handle, file_info: ^ByHandleFileInformation) -> Bool #cc_std #link_name "GetFileInformationByHandle" ---;
|
||||
|
||||
proc get_file_type (file_handle: Handle) -> u32 #cc_std #link_name "GetFileType";
|
||||
proc set_file_pointer(file_handle: Handle, distance_to_move: i32, distance_to_move_high: ^i32, move_method: u32) -> u32 #cc_std #link_name "SetFilePointer";
|
||||
get_file_type :: proc(file_handle: Handle) -> u32 #cc_std #link_name "GetFileType" ---;
|
||||
set_file_pointer :: proc(file_handle: Handle, distance_to_move: i32, distance_to_move_high: ^i32, move_method: u32) -> u32 #cc_std #link_name "SetFilePointer" ---;
|
||||
|
||||
proc set_handle_information(obj: Handle, mask, flags: u32) -> Bool #cc_std #link_name "SetHandleInformation";
|
||||
set_handle_information :: proc(obj: Handle, mask, flags: u32) -> Bool #cc_std #link_name "SetHandleInformation" ---;
|
||||
|
||||
proc find_first_file_a(file_name : ^u8, data : ^FindData) -> Handle #cc_std #link_name "FindFirstFileA";
|
||||
proc find_next_file_a (file : Handle, data : ^FindData) -> Bool #cc_std #link_name "FindNextFileA";
|
||||
proc find_close (file : Handle) -> Bool #cc_std #link_name "FindClose";
|
||||
find_first_file_a :: proc(file_name : ^u8, data : ^FindData) -> Handle #cc_std #link_name "FindFirstFileA" ---;
|
||||
find_next_file_a :: proc(file : Handle, data : ^FindData) -> Bool #cc_std #link_name "FindNextFileA" ---;
|
||||
find_close :: proc(file : Handle) -> Bool #cc_std #link_name "FindClose" ---;
|
||||
|
||||
|
||||
proc heap_alloc (h: Handle, flags: u32, bytes: int) -> rawptr #cc_std #link_name "HeapAlloc";
|
||||
proc heap_realloc (h: Handle, flags: u32, memory: rawptr, bytes: int) -> rawptr #cc_std #link_name "HeapReAlloc";
|
||||
proc heap_free (h: Handle, flags: u32, memory: rawptr) -> Bool #cc_std #link_name "HeapFree";
|
||||
proc get_process_heap() -> Handle #cc_std #link_name "GetProcessHeap";
|
||||
heap_alloc :: proc(h: Handle, flags: u32, bytes: int) -> rawptr #cc_std #link_name "HeapAlloc" ---;
|
||||
heap_realloc :: proc(h: Handle, flags: u32, memory: rawptr, bytes: int) -> rawptr #cc_std #link_name "HeapReAlloc" ---;
|
||||
heap_free :: proc(h: Handle, flags: u32, memory: rawptr) -> Bool #cc_std #link_name "HeapFree" ---;
|
||||
get_process_heap :: proc() -> Handle #cc_std #link_name "GetProcessHeap" ---;
|
||||
|
||||
|
||||
proc create_semaphore_a (attributes: ^Security_Attributes, initial_count, maximum_count: i32, name: ^u8) -> Handle #cc_std #link_name "CreateSemaphoreA";
|
||||
proc release_semaphore (semaphore: Handle, release_count: i32, previous_count: ^i32) -> Bool #cc_std #link_name "ReleaseSemaphore";
|
||||
proc wait_for_single_object(handle: Handle, milliseconds: u32) -> u32 #cc_std #link_name "WaitForSingleObject";
|
||||
create_semaphore_a :: proc(attributes: ^Security_Attributes, initial_count, maximum_count: i32, name: ^u8) -> Handle #cc_std #link_name "CreateSemaphoreA" ---;
|
||||
release_semaphore :: proc(semaphore: Handle, release_count: i32, previous_count: ^i32) -> Bool #cc_std #link_name "ReleaseSemaphore" ---;
|
||||
wait_for_single_object :: proc(handle: Handle, milliseconds: u32) -> u32 #cc_std #link_name "WaitForSingleObject" ---;
|
||||
|
||||
|
||||
proc interlocked_compare_exchange (dst: ^i32, exchange, comparand: i32) -> i32 #cc_std #link_name "InterlockedCompareExchange";
|
||||
proc interlocked_exchange (dst: ^i32, desired: i32) -> i32 #cc_std #link_name "InterlockedExchange";
|
||||
proc interlocked_exchange_add (dst: ^i32, desired: i32) -> i32 #cc_std #link_name "InterlockedExchangeAdd";
|
||||
proc interlocked_and (dst: ^i32, desired: i32) -> i32 #cc_std #link_name "InterlockedAnd";
|
||||
proc interlocked_or (dst: ^i32, desired: i32) -> i32 #cc_std #link_name "InterlockedOr";
|
||||
interlocked_compare_exchange :: proc(dst: ^i32, exchange, comparand: i32) -> i32 #cc_std #link_name "InterlockedCompareExchange" ---;
|
||||
interlocked_exchange :: proc(dst: ^i32, desired: i32) -> i32 #cc_std #link_name "InterlockedExchange" ---;
|
||||
interlocked_exchange_add :: proc(dst: ^i32, desired: i32) -> i32 #cc_std #link_name "InterlockedExchangeAdd" ---;
|
||||
interlocked_and :: proc(dst: ^i32, desired: i32) -> i32 #cc_std #link_name "InterlockedAnd" ---;
|
||||
interlocked_or :: proc(dst: ^i32, desired: i32) -> i32 #cc_std #link_name "InterlockedOr" ---;
|
||||
|
||||
proc interlocked_compare_exchange64(dst: ^i64, exchange, comparand: i64) -> i64 #cc_std #link_name "InterlockedCompareExchange64";
|
||||
proc interlocked_exchange64 (dst: ^i64, desired: i64) -> i64 #cc_std #link_name "InterlockedExchange64";
|
||||
proc interlocked_exchange_add64 (dst: ^i64, desired: i64) -> i64 #cc_std #link_name "InterlockedExchangeAdd64";
|
||||
proc interlocked_and64 (dst: ^i64, desired: i64) -> i64 #cc_std #link_name "InterlockedAnd64";
|
||||
proc interlocked_or64 (dst: ^i64, desired: i64) -> i64 #cc_std #link_name "InterlockedOr64";
|
||||
interlocked_compare_exchange64 :: proc(dst: ^i64, exchange, comparand: i64) -> i64 #cc_std #link_name "InterlockedCompareExchange64" ---;
|
||||
interlocked_exchange64 :: proc(dst: ^i64, desired: i64) -> i64 #cc_std #link_name "InterlockedExchange64" ---;
|
||||
interlocked_exchange_add64 :: proc(dst: ^i64, desired: i64) -> i64 #cc_std #link_name "InterlockedExchangeAdd64" ---;
|
||||
interlocked_and64 :: proc(dst: ^i64, desired: i64) -> i64 #cc_std #link_name "InterlockedAnd64" ---;
|
||||
interlocked_or64 :: proc(dst: ^i64, desired: i64) -> i64 #cc_std #link_name "InterlockedOr64" ---;
|
||||
|
||||
proc mm_pause () #cc_std #link_name "_mm_pause";
|
||||
proc read_write_barrier() #cc_std #link_name "ReadWriteBarrier";
|
||||
proc write_barrier () #cc_std #link_name "WriteBarrier";
|
||||
proc read_barrier () #cc_std #link_name "ReadBarrier";
|
||||
mm_pause :: proc() #cc_std #link_name "_mm_pause" ---;
|
||||
read_write_barrier :: proc() #cc_std #link_name "ReadWriteBarrier" ---;
|
||||
write_barrier :: proc() #cc_std #link_name "WriteBarrier" ---;
|
||||
read_barrier :: proc() #cc_std #link_name "ReadBarrier" ---;
|
||||
|
||||
|
||||
proc load_library_a (c_str: ^u8) -> Hmodule #cc_std #link_name "LoadLibraryA";
|
||||
proc free_library (h: Hmodule) #cc_std #link_name "FreeLibrary";
|
||||
proc get_proc_address(h: Hmodule, c_str: ^u8) -> Proc #cc_std #link_name "GetProcAddress";
|
||||
load_library_a :: proc(c_str: ^u8) -> Hmodule #cc_std #link_name "LoadLibraryA" ---;
|
||||
free_library :: proc(h: Hmodule) #cc_std #link_name "FreeLibrary" ---;
|
||||
get_proc_address :: proc(h: Hmodule, c_str: ^u8) -> Proc #cc_std #link_name "GetProcAddress" ---;
|
||||
|
||||
}
|
||||
|
||||
foreign user32 {
|
||||
proc get_desktop_window () -> Hwnd #cc_std #link_name "GetDesktopWindow";
|
||||
proc show_cursor (show : Bool) #cc_std #link_name "ShowCursor";
|
||||
proc get_cursor_pos (p: ^Point) -> i32 #cc_std #link_name "GetCursorPos";
|
||||
proc screen_to_client (h: Hwnd, p: ^Point) -> i32 #cc_std #link_name "ScreenToClient";
|
||||
proc post_quit_message (exit_code: i32) #cc_std #link_name "PostQuitMessage";
|
||||
proc set_window_text_a (hwnd: Hwnd, c_string: ^u8) -> Bool #cc_std #link_name "SetWindowTextA";
|
||||
proc register_class_ex_a (wc: ^WndClassExA) -> i16 #cc_std #link_name "RegisterClassExA";
|
||||
get_desktop_window :: proc() -> Hwnd #cc_std #link_name "GetDesktopWindow" ---;
|
||||
show_cursor :: proc(show : Bool) #cc_std #link_name "ShowCursor" ---;
|
||||
get_cursor_pos :: proc(p: ^Point) -> i32 #cc_std #link_name "GetCursorPos" ---;
|
||||
screen_to_client :: proc(h: Hwnd, p: ^Point) -> i32 #cc_std #link_name "ScreenToClient" ---;
|
||||
post_quit_message :: proc(exit_code: i32) #cc_std #link_name "PostQuitMessage" ---;
|
||||
set_window_text_a :: proc(hwnd: Hwnd, c_string: ^u8) -> Bool #cc_std #link_name "SetWindowTextA" ---;
|
||||
register_class_ex_a :: proc(wc: ^WndClassExA) -> i16 #cc_std #link_name "RegisterClassExA" ---;
|
||||
|
||||
proc create_window_ex_a (ex_style: u32,
|
||||
class_name, title: ^u8,
|
||||
style: u32,
|
||||
x, y, w, h: i32,
|
||||
parent: Hwnd, menu: Hmenu, instance: Hinstance,
|
||||
param: rawptr) -> Hwnd #cc_std #link_name "CreateWindowExA";
|
||||
create_window_ex_a :: proc(ex_style: u32,
|
||||
class_name, title: ^u8,
|
||||
style: u32,
|
||||
x, y, w, h: i32,
|
||||
parent: Hwnd, menu: Hmenu, instance: Hinstance,
|
||||
param: rawptr) -> Hwnd #cc_std #link_name "CreateWindowExA" ---;
|
||||
|
||||
proc show_window (hwnd: Hwnd, cmd_show: i32) -> Bool #cc_std #link_name "ShowWindow";
|
||||
proc translate_message (msg: ^Msg) -> Bool #cc_std #link_name "TranslateMessage";
|
||||
proc dispatch_message_a (msg: ^Msg) -> Lresult #cc_std #link_name "DispatchMessageA";
|
||||
proc update_window (hwnd: Hwnd) -> Bool #cc_std #link_name "UpdateWindow";
|
||||
proc get_message_a (msg: ^Msg, hwnd: Hwnd, msg_filter_min, msg_filter_max : u32) -> Bool #cc_std #link_name "GetMessageA";
|
||||
proc peek_message_a (msg: ^Msg, hwnd: Hwnd,
|
||||
msg_filter_min, msg_filter_max, remove_msg: u32) -> Bool #cc_std #link_name "PeekMessageA";
|
||||
show_window :: proc(hwnd: Hwnd, cmd_show: i32) -> Bool #cc_std #link_name "ShowWindow" ---;
|
||||
translate_message :: proc(msg: ^Msg) -> Bool #cc_std #link_name "TranslateMessage" ---;
|
||||
dispatch_message_a :: proc(msg: ^Msg) -> Lresult #cc_std #link_name "DispatchMessageA" ---;
|
||||
update_window :: proc(hwnd: Hwnd) -> Bool #cc_std #link_name "UpdateWindow" ---;
|
||||
get_message_a :: proc(msg: ^Msg, hwnd: Hwnd, msg_filter_min, msg_filter_max : u32) -> Bool #cc_std #link_name "GetMessageA" ---;
|
||||
peek_message_a :: proc(msg: ^Msg, hwnd: Hwnd,
|
||||
msg_filter_min, msg_filter_max, remove_msg: u32) -> Bool #cc_std #link_name "PeekMessageA" ---;
|
||||
|
||||
|
||||
proc post_message (hwnd: Hwnd, msg, wparam, lparam : u32) -> Bool #cc_std #link_name "PostMessageA";
|
||||
post_message :: proc(hwnd: Hwnd, msg, wparam, lparam : u32) -> Bool #cc_std #link_name "PostMessageA" ---;
|
||||
|
||||
proc def_window_proc_a (hwnd: Hwnd, msg: u32, wparam: Wparam, lparam: Lparam) -> Lresult #cc_std #link_name "DefWindowProcA";
|
||||
def_window_proc_a :: proc(hwnd: Hwnd, msg: u32, wparam: Wparam, lparam: Lparam) -> Lresult #cc_std #link_name "DefWindowProcA" ---;
|
||||
|
||||
proc adjust_window_rect (rect: ^Rect, style: u32, menu: Bool) -> Bool #cc_std #link_name "AdjustWindowRect";
|
||||
proc get_active_window () -> Hwnd #cc_std #link_name "GetActiveWindow";
|
||||
adjust_window_rect :: proc(rect: ^Rect, style: u32, menu: Bool) -> Bool #cc_std #link_name "AdjustWindowRect" ---;
|
||||
get_active_window :: proc() -> Hwnd #cc_std #link_name "GetActiveWindow" ---;
|
||||
|
||||
proc destroy_window (wnd: Hwnd) -> Bool #cc_std #link_name "DestroyWindow";
|
||||
proc describe_pixel_format(dc: Hdc, pixel_format: i32, bytes : u32, pfd: ^PixelFormatDescriptor) -> i32 #cc_std #link_name "DescribePixelFormat";
|
||||
destroy_window :: proc(wnd: Hwnd) -> Bool #cc_std #link_name "DestroyWindow" ---;
|
||||
describe_pixel_format :: proc(dc: Hdc, pixel_format: i32, bytes : u32, pfd: ^PixelFormatDescriptor) -> i32 #cc_std #link_name "DescribePixelFormat" ---;
|
||||
|
||||
proc get_monitor_info_a (monitor: Hmonitor, mi: ^MonitorInfo) -> Bool #cc_std #link_name "GetMonitorInfoA";
|
||||
proc monitor_from_window (wnd: Hwnd, flags : u32) -> Hmonitor #cc_std #link_name "MonitorFromWindow";
|
||||
get_monitor_info_a :: proc(monitor: Hmonitor, mi: ^MonitorInfo) -> Bool #cc_std #link_name "GetMonitorInfoA" ---;
|
||||
monitor_from_window :: proc(wnd: Hwnd, flags : u32) -> Hmonitor #cc_std #link_name "MonitorFromWindow" ---;
|
||||
|
||||
proc set_window_pos (wnd: Hwnd, wndInsertAfter: Hwnd, x, y, width, height: i32, flags: u32) #cc_std #link_name "SetWindowPos";
|
||||
set_window_pos :: proc(wnd: Hwnd, wndInsertAfter: Hwnd, x, y, width, height: i32, flags: u32) #cc_std #link_name "SetWindowPos" ---;
|
||||
|
||||
proc get_window_placement (wnd: Hwnd, wndpl: ^WindowPlacement) -> Bool #cc_std #link_name "GetWindowPlacement";
|
||||
proc set_window_placement (wnd: Hwnd, wndpl: ^WindowPlacement) -> Bool #cc_std #link_name "SetWindowPlacement";
|
||||
proc get_window_rect (wnd: Hwnd, rect: ^Rect) -> Bool #cc_std #link_name "GetWindowRect";
|
||||
get_window_placement :: proc(wnd: Hwnd, wndpl: ^WindowPlacement) -> Bool #cc_std #link_name "GetWindowPlacement" ---;
|
||||
set_window_placement :: proc(wnd: Hwnd, wndpl: ^WindowPlacement) -> Bool #cc_std #link_name "SetWindowPlacement" ---;
|
||||
get_window_rect :: proc(wnd: Hwnd, rect: ^Rect) -> Bool #cc_std #link_name "GetWindowRect" ---;
|
||||
|
||||
proc get_window_long_ptr_a(wnd: Hwnd, index: i32) -> i64 #cc_std #link_name "GetWindowLongPtrA";
|
||||
proc set_window_long_ptr_a(wnd: Hwnd, index: i32, new: i64) -> i64 #cc_std #link_name "SetWindowLongPtrA";
|
||||
get_window_long_ptr_a :: proc(wnd: Hwnd, index: i32) -> i64 #cc_std #link_name "GetWindowLongPtrA" ---;
|
||||
set_window_long_ptr_a :: proc(wnd: Hwnd, index: i32, new: i64) -> i64 #cc_std #link_name "SetWindowLongPtrA" ---;
|
||||
|
||||
proc get_window_text (wnd: Hwnd, str: ^u8, maxCount: i32) -> i32 #cc_std #link_name "GetWindowText";
|
||||
get_window_text :: proc(wnd: Hwnd, str: ^u8, maxCount: i32) -> i32 #cc_std #link_name "GetWindowText" ---;
|
||||
|
||||
proc get_client_rect (hwnd: Hwnd, rect: ^Rect) -> Bool #cc_std #link_name "GetClientRect";
|
||||
get_client_rect :: proc(hwnd: Hwnd, rect: ^Rect) -> Bool #cc_std #link_name "GetClientRect" ---;
|
||||
|
||||
proc get_dc (h: Hwnd) -> Hdc #cc_std #link_name "GetDC";
|
||||
proc release_dc (wnd: Hwnd, hdc: Hdc) -> i32 #cc_std #link_name "ReleaseDC";
|
||||
get_dc :: proc(h: Hwnd) -> Hdc #cc_std #link_name "GetDC" ---;
|
||||
release_dc :: proc(wnd: Hwnd, hdc: Hdc) -> i32 #cc_std #link_name "ReleaseDC" ---;
|
||||
|
||||
proc map_virtual_key(scancode : u32, map_type : u32) -> u32 #cc_std #link_name "MapVirtualKeyA";
|
||||
map_virtual_key :: proc(scancode : u32, map_type : u32) -> u32 #cc_std #link_name "MapVirtualKeyA" ---;
|
||||
|
||||
proc get_key_state (v_key: i32) -> i16 #cc_std #link_name "GetKeyState";
|
||||
proc get_async_key_state(v_key: i32) -> i16 #cc_std #link_name "GetAsyncKeyState";
|
||||
get_key_state :: proc(v_key: i32) -> i16 #cc_std #link_name "GetKeyState" ---;
|
||||
get_async_key_state :: proc(v_key: i32) -> i16 #cc_std #link_name "GetAsyncKeyState" ---;
|
||||
}
|
||||
|
||||
foreign gdi32 {
|
||||
proc get_stock_object(fn_object: i32) -> Hgdiobj #cc_std #link_name "GetStockObject";
|
||||
get_stock_object :: proc(fn_object: i32) -> Hgdiobj #cc_std #link_name "GetStockObject" ---;
|
||||
|
||||
proc stretch_dibits( hdc: Hdc,
|
||||
stretch_dibits :: proc(hdc: Hdc,
|
||||
x_dst, y_dst, width_dst, height_dst: i32,
|
||||
x_src, y_src, width_src, header_src: i32,
|
||||
bits: rawptr, bits_info: ^BitmapInfo,
|
||||
usage: u32,
|
||||
rop: u32) -> i32 #cc_std #link_name "StretchDIBits";
|
||||
rop: u32) -> i32 #cc_std #link_name "StretchDIBits" ---;
|
||||
|
||||
proc set_pixel_format (hdc: Hdc, pixel_format: i32, pfd: ^PixelFormatDescriptor) -> Bool #cc_std #link_name "SetPixelFormat";
|
||||
proc choose_pixel_format(hdc: Hdc, pfd: ^PixelFormatDescriptor) -> i32 #cc_std #link_name "ChoosePixelFormat";
|
||||
proc swap_buffers (hdc: Hdc) -> Bool #cc_std #link_name "SwapBuffers";
|
||||
set_pixel_format :: proc(hdc: Hdc, pixel_format: i32, pfd: ^PixelFormatDescriptor) -> Bool #cc_std #link_name "SetPixelFormat" ---;
|
||||
choose_pixel_format :: proc(hdc: Hdc, pfd: ^PixelFormatDescriptor) -> i32 #cc_std #link_name "ChoosePixelFormat" ---;
|
||||
swap_buffers :: proc(hdc: Hdc) -> Bool #cc_std #link_name "SwapBuffers" ---;
|
||||
|
||||
}
|
||||
|
||||
foreign shell32 {
|
||||
proc command_line_to_argv_w(cmd_list: ^u16, num_args: ^i32) -> ^^u16 #cc_std #link_name "CommandLineToArgvW";
|
||||
command_line_to_argv_w :: proc(cmd_list: ^u16, num_args: ^i32) -> ^^u16 #cc_std #link_name "CommandLineToArgvW" ---;
|
||||
}
|
||||
|
||||
foreign winmm {
|
||||
proc time_get_time() -> u32 #cc_std #link_name "timeGetTime";
|
||||
time_get_time :: proc() -> u32 #cc_std #link_name "timeGetTime" ---;
|
||||
}
|
||||
|
||||
|
||||
|
||||
proc get_query_performance_frequency() -> i64 {
|
||||
get_query_performance_frequency :: proc() -> i64 {
|
||||
r: i64;
|
||||
query_performance_frequency(&r);
|
||||
return r;
|
||||
}
|
||||
|
||||
proc HIWORD(wParam: Wparam) -> u16 { return u16((u32(wParam) >> 16) & 0xffff); }
|
||||
proc HIWORD(lParam: Lparam) -> u16 { return u16((u32(lParam) >> 16) & 0xffff); }
|
||||
proc LOWORD(wParam: Wparam) -> u16 { return u16(wParam); }
|
||||
proc LOWORD(lParam: Lparam) -> u16 { return u16(lParam); }
|
||||
HIWORD :: proc(wParam: Wparam) -> u16 { return u16((u32(wParam) >> 16) & 0xffff); }
|
||||
HIWORD :: proc(lParam: Lparam) -> u16 { return u16((u32(lParam) >> 16) & 0xffff); }
|
||||
LOWORD :: proc(wParam: Wparam) -> u16 { return u16(wParam); }
|
||||
LOWORD :: proc(lParam: Lparam) -> u16 { return u16(lParam); }
|
||||
|
||||
proc is_key_down(key: KeyCode) -> bool #inline { return get_async_key_state(i32(key)) < 0; }
|
||||
is_key_down :: proc(key: KeyCode) -> bool #inline { return get_async_key_state(i32(key)) < 0; }
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user