diff --git a/extensions/pl_gpu_allocators_ext.h b/extensions/pl_gpu_allocators_ext.h index e40baadd..170a0ef4 100644 --- a/extensions/pl_gpu_allocators_ext.h +++ b/extensions/pl_gpu_allocators_ext.h @@ -72,8 +72,8 @@ typedef struct _plGPUAllocatorsI void (*cleanup)(plDevice*); // for debug viewing - plDeviceMemoryAllocation* (*get_blocks)(const plDeviceMemoryAllocatorI*, uint32_t* puSizeOut); - plDeviceAllocationRange* (*get_ranges)(const plDeviceMemoryAllocatorI*, uint32_t* puSizeOut); + plDeviceMemoryAllocation* (*get_blocks)(const plDeviceMemoryAllocatorI*, uint32_t* sizeOut); + plDeviceAllocationRange* (*get_ranges)(const plDeviceMemoryAllocatorI*, uint32_t* sizeOut); } plGPUAllocatorsI; diff --git a/extensions/pl_image_ext.h b/extensions/pl_image_ext.h index b2b88cee..f2a5f244 100644 --- a/extensions/pl_image_ext.h +++ b/extensions/pl_image_ext.h @@ -51,28 +51,28 @@ typedef struct _plImageWriteInfo plImageWriteInfo; typedef struct _plImageI { // query image info - bool (*get_info) (char const* pcFilename, plImageInfo* ptInfoOut); - bool (*get_info_from_memory)(const unsigned char* pcBuffer, int iLength, plImageInfo* ptInfoOut); + bool (*get_info) (char const* filename, plImageInfo* infoOut); + bool (*get_info_from_memory)(const unsigned char* buffer, int length, plImageInfo* infoOut); // reading LDR (HDR will be remapped through this interface) - unsigned char* (*load_from_memory) (const unsigned char* pcBuffer, int iLength, int* piX, int* piY, int* piChannels, int iDesiredChannels); - unsigned char* (*load) (char const* pcFilename, int* piX, int* piY, int* piChannels, int iDesiredChannels); - unsigned short* (*load_16bit_from_memory)(const unsigned char* pcBuffer, int iLength, int* piX, int* piY, int* piChannels, int iDesiredChannels); - unsigned short* (*load_16bit) (char const* pcFilename, int* piX, int* piY, int* piChannels, int iDesiredChannels); + unsigned char* (*load_from_memory) (const unsigned char* buffer, int length, int* x, int* y, int* channels, int desiredChannels); + unsigned char* (*load) (char const* filename, int* x, int* y, int* channels, int desiredChannels); + unsigned short* (*load_16bit_from_memory)(const unsigned char* buffer, int length, int* x, int* y, int* channels, int desiredChannels); + unsigned short* (*load_16bit) (char const* filename, int* y, int* x, int* channels, int desiredChannels); void (*set_hdr_to_ldr_gamma) (float); // default 2.2f void (*set_hdr_to_ldr_scale) (float); // default 1.0f // reading HDR (LDR will be promoted to floating point values) - float* (*load_hdr_from_memory)(const unsigned char* pcBuffer, int iLength, int* piX, int* piY, int* piChannels, int iDesiredChannels); - float* (*load_hdr) (char const* pcFilename, int* piX, int* piY, int* piChannels, int iDesiredChannels); + float* (*load_hdr_from_memory)(const unsigned char* buffer, int length, int* x, int* y, int* channels, int desiredChannels); + float* (*load_hdr) (char const* filename, int* x, int* y, int* channels, int desiredChannels); void (*set_ldr_to_hdr_gamma)(float); // default 2.2f void (*set_ldr_to_hdr_scale)(float); // default 1.0f // call when finished with memory - void (*free)(void* pRetValueFromLoad); + void (*free)(void* returnValueFromLoad); // writing to disk (currently supports png, jpg, bmp, hdr, tga) - bool (*write)(char const *pcFileName, const void *pData, const plImageWriteInfo*); + bool (*write)(char const* filename, const void* data, const plImageWriteInfo*); } plImageI; //----------------------------------------------------------------------------- diff --git a/extensions/pl_job_ext.h b/extensions/pl_job_ext.h index 446dbf51..eae8b700 100644 --- a/extensions/pl_job_ext.h +++ b/extensions/pl_job_ext.h @@ -54,14 +54,14 @@ typedef struct _plAtomicCounter plAtomicCounter; // pl_os.h typedef struct _plJobI { // setup/shutdown - void (*initialize)(uint32_t uThreadCount); // set thread count to 0 to get optimal thread count + void (*initialize)(uint32_t threadCount); // set thread count to 0 to get optimal thread count void (*cleanup)(void); // typical usage // - submit an array of job descriptions and receive an atomic counter pointer // - pass NULL for the atomic counter pointer if you don't need to wait (fire & forget) // - use "wait_for_counter" to wait on jobs to complete and return counter for reuse - void (*dispatch_jobs)(uint32_t uJobCount, plJobDesc*, plAtomicCounter**); + void (*dispatch_jobs)(uint32_t jobCount, plJobDesc*, plAtomicCounter**); // batch usage // Follows more of a compute shader design. All jobs use the same data which can be indexed @@ -69,7 +69,7 @@ typedef struct _plJobI // - uJobCount : how many jobs to generate // - uGroupSize : how many jobs to execute per thread serially (set 0 for optimal group size) // - pass NULL for the atomic counter pointer if you don't need to wait (fire & forget) - void (*dispatch_batch)(uint32_t uJobCount, uint32_t uGroupSize, plJobDesc, plAtomicCounter**); + void (*dispatch_batch)(uint32_t jobCount, uint32_t groupSize, plJobDesc, plAtomicCounter**); // waits for counter to reach 0 and returns the counter for reuse but subsequent dispatches void (*wait_for_counter)(plAtomicCounter*); diff --git a/extensions/pl_rect_pack_ext.h b/extensions/pl_rect_pack_ext.h index 571a33c8..e353ac24 100644 --- a/extensions/pl_rect_pack_ext.h +++ b/extensions/pl_rect_pack_ext.h @@ -47,7 +47,7 @@ typedef struct _plPackRect plPackRect; typedef struct _plRectPackI { - void (*pack_rects)(int iWidth, int iHeight, plPackRect*, uint32_t uRectCount); + void (*pack_rects)(int width, int height, plPackRect*, uint32_t rectCount); } plRectPackI; //----------------------------------------------------------------------------- diff --git a/extensions/pl_shader_ext.h b/extensions/pl_shader_ext.h index 43f96040..2b2f6e31 100644 --- a/extensions/pl_shader_ext.h +++ b/extensions/pl_shader_ext.h @@ -69,14 +69,14 @@ typedef struct _plShaderI bool (*initialize)(const plShaderOptions*); // load shader (compile if not already compiled) - plShaderModule (*load_glsl)(const char* pcShader, const char* pcEntryFunc, const char* pcFile, plShaderOptions*); + plShaderModule (*load_glsl)(const char* shader, const char* entryFunc, const char* file, plShaderOptions*); // compilation (pass null shader options to use default) - plShaderModule (*compile_glsl) (const char* pcShader, const char* pcEntryFunc, plShaderOptions*); + plShaderModule (*compile_glsl) (const char* shader, const char* entryFunc, plShaderOptions*); // write/read on disk - void (*write_to_disk) (const char* pcShader, const plShaderModule*); - plShaderModule (*read_from_disk)(const char* pcShader, const char* pcEntryFunc); + void (*write_to_disk) (const char* shader, const plShaderModule*); + plShaderModule (*read_from_disk)(const char* shader, const char* entryFunc); } plShaderI; //----------------------------------------------------------------------------- diff --git a/extensions/pl_stats_ext.h b/extensions/pl_stats_ext.h index 7231357c..19d49c32 100644 --- a/extensions/pl_stats_ext.h +++ b/extensions/pl_stats_ext.h @@ -46,11 +46,11 @@ typedef struct _plStatsI // provides a pointer to a value for the counter // (user should store this pointer to prevent lookups every frame) - double* (*get_counter)(char const* pcName); + double* (*get_counter)(char const* name); // provides stat data back to user for analysis/display/etc. - double** (*get_counter_data)(char const* pcName); // set point to valid memory - const char** (*get_names) (uint32_t* puCount); + double** (*get_counter_data)(char const* name); // set point to valid memory + const char** (*get_names) (uint32_t* countOut); // settings void (*set_max_frames)(uint32_t); // default: 120 diff --git a/src/pl.h b/src/pl.h index 9b27a883..f8dc1796 100644 --- a/src/pl.h +++ b/src/pl.h @@ -84,31 +84,31 @@ typedef uint16_t plUiWChar; typedef struct _plApiRegistryI { - const void* (*add) (const char* pcName, const void* pInterface); - void (*remove)(const void* pInterface); - const void* (*first) (const char* pcName); - const void* (*next) (const void* pPrevInterface); + const void* (*add) (const char* name, const void* interface); + void (*remove)(const void* interface); + const void* (*first) (const char* name); + const void* (*next) (const void* prevInterface); } plApiRegistryI; typedef struct _plExtensionRegistryI { - bool (*load) (const char* pcName, const char* pcLoadFunc, const char* pcUnloadFunc, bool bReloadable); - bool (*unload)(const char* pcName); + bool (*load) (const char* name, const char* loadFunc, const char* unloadFunc, bool reloadable); + bool (*unload)(const char* name); } plExtensionRegistryI; typedef struct _plMemoryI { - void* (*realloc)(void*, size_t, const char* pcFile, int iLine); + void* (*realloc)(void*, size_t, const char* file, int line); // stats size_t (*get_memory_usage)(void); size_t (*get_allocation_count)(void); size_t (*get_free_count)(void); - plAllocationEntry* (*get_allocations)(size_t* pszCount); + plAllocationEntry* (*get_allocations)(size_t* countOut); } plMemoryI; @@ -120,32 +120,32 @@ typedef struct _plIOI // keyboard bool (*is_key_down) (plKey); - bool (*is_key_pressed) (plKey, bool bRepeat); + bool (*is_key_pressed) (plKey, bool repeat); bool (*is_key_released) (plKey); - int (*get_key_pressed_amount)(plKey, float fRepeatDelay, float fRate); + int (*get_key_pressed_amount)(plKey, float repeatDelay, float rate); // mouse bool (*is_mouse_down) (plMouseButton); - bool (*is_mouse_clicked) (plMouseButton, bool bRepeat); + bool (*is_mouse_clicked) (plMouseButton, bool repeat); bool (*is_mouse_released) (plMouseButton); bool (*is_mouse_double_clicked)(plMouseButton); - bool (*is_mouse_dragging) (plMouseButton, float fThreshold); + bool (*is_mouse_dragging) (plMouseButton, float threshold); bool (*is_mouse_hovering_rect) (plVec2 minVec, plVec2 maxVec); void (*reset_mouse_drag_delta) (plMouseButton); - plVec2 (*get_mouse_drag_delta) (plMouseButton, float fThreshold); + plVec2 (*get_mouse_drag_delta) (plMouseButton, float threshold); plVec2 (*get_mouse_pos) (void); float (*get_mouse_wheel) (void); bool (*is_mouse_pos_valid) (plVec2); void (*set_mouse_cursor) (plMouseCursor); // input functions (used by backends) - void (*add_key_event) (plKey, bool bDown); + void (*add_key_event) (plKey, bool down); void (*add_text_event) (uint32_t uChar); void (*add_text_event_utf16) (uint16_t uChar); - void (*add_text_events_utf8) (const char* pcText); + void (*add_text_events_utf8) (const char* text); void (*add_mouse_pos_event) (float x, float y); - void (*add_mouse_button_event)(int iButton, bool bDown); - void (*add_mouse_wheel_event) (float fHorizontalDelta, float fVerticalDelta); + void (*add_mouse_button_event)(int button, bool down); + void (*add_mouse_wheel_event) (float horizontalDelta, float verticalDelta); void (*clear_input_characters)(void); // misc. @@ -158,8 +158,8 @@ typedef struct _plDataRegistryI { // for convience, only use for infrequent operations (i.e. global extension data) - void (*set_data)(const char* pcName, void* pData); - void* (*get_data)(const char* pcName); + void (*set_data)(const char* name, void* data); + void* (*get_data)(const char* name); //~~~~~~~~~~~~~~~~~~~~~~~~~do not use below here yet~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -168,18 +168,18 @@ typedef struct _plDataRegistryI // object creation & retrieval plDataID (*create_object) (void); - plDataID (*get_object_by_name)(const char* pcName); // assumes property 0 is name + plDataID (*get_object_by_name)(const char* name); // assumes property 0 is name // reading (no locking or waiting) const plDataObject* (*read) (plDataID); - const char* (*get_string)(const plDataObject*, uint32_t uProperty); - void* (*get_buffer)(const plDataObject*, uint32_t uProperty); + const char* (*get_string)(const plDataObject*, uint32_t property); + void* (*get_buffer)(const plDataObject*, uint32_t property); void (*end_read) (const plDataObject*); // writing (global lock) plDataObject* (*write) (plDataID); - void (*set_string)(plDataObject*, uint32_t uProperty, const char*); - void (*set_buffer)(plDataObject*, uint32_t uProperty, void*); + void (*set_string)(plDataObject*, uint32_t property, const char*); + void (*set_buffer)(plDataObject*, uint32_t property, void*); void (*commit) (plDataObject*); } plDataRegistryI; diff --git a/src/pl_os.h b/src/pl_os.h index 8679efa0..3c6e932f 100644 --- a/src/pl_os.h +++ b/src/pl_os.h @@ -90,7 +90,7 @@ typedef void* (*plThreadProcedure)(void*); typedef struct _plWindowI { - plOSResult (*create_window) (const plWindowDesc*, plWindow** pptWindowOut); + plOSResult (*create_window) (const plWindowDesc*, plWindow** windowPtrOut); void (*destroy_window)(plWindow*); } plWindowI; @@ -98,7 +98,7 @@ typedef struct _plWindowI typedef struct _plLibraryI { - plOSResult (*load) (const plLibraryDesc*, plSharedLibrary** pptLibraryOut); + plOSResult (*load) (const plLibraryDesc*, plSharedLibrary** libraryPtrOut); bool (*has_changed) (plSharedLibrary*); void (*reload) (plSharedLibrary*); void* (*load_function)(plSharedLibrary*, const char*); @@ -109,13 +109,13 @@ typedef struct _plFileI { // simple file ops - bool (*exists)(const char* pcPath); - plOSResult (*delete)(const char* pcPath); - plOSResult (*copy) (const char* pcSource, const char* pcDestination); + bool (*exists)(const char* path); + plOSResult (*delete)(const char* path); + plOSResult (*copy) (const char* source, const char* destination); // binary files - plOSResult (*binary_read) (const char* pcFile, size_t* pszSize, uint8_t* puBuffer); // pass NULL for puBuffer to get size - plOSResult (*binary_write)(const char* pcFile, size_t, uint8_t* puBuffer); + plOSResult (*binary_read) (const char* file, size_t* sizeOut, uint8_t* buffer); // pass NULL for puBuffer to get size + plOSResult (*binary_write)(const char* file, size_t, uint8_t* buffer); } plFileI; @@ -123,25 +123,25 @@ typedef struct _plNetworkI { // addresses - plOSResult (*create_address) (const char* pcAddress, const char* pcService, plNetworkAddressFlags, plNetworkAddress** pptAddressOut); + plOSResult (*create_address) (const char* address, const char* service, plNetworkAddressFlags, plNetworkAddress** addressPtrOut); void (*destroy_address)(plNetworkAddress**); // sockets: general - void (*create_socket) (plSocketFlags, plSocket** pptSocketOut); + void (*create_socket) (plSocketFlags, plSocket** socketPtrOut); void (*destroy_socket)(plSocket**); plOSResult (*bind_socket) (plSocket*, plNetworkAddress*); // sockets: udp usually - plOSResult (*send_socket_data_to) (plSocket*, plNetworkAddress*, const void* pData, size_t, size_t* pszSentSizeOut); - plOSResult (*get_socket_data_from)(plSocket*, void* pOutData, size_t, size_t* pszRecievedSize, plSocketReceiverInfo*); + plOSResult (*send_socket_data_to) (plSocket*, plNetworkAddress*, const void* data, size_t, size_t* sentPtrSizeOut); + plOSResult (*get_socket_data_from)(plSocket*, void* dataOut, size_t, size_t* recievedPtrSize, plSocketReceiverInfo*); // sockets: tcp usually - plOSResult (*select_sockets) (plSocket** atSockets, bool* abSelectedSockets, uint32_t uSocketCount, uint32_t uTimeOutMilliSec); + plOSResult (*select_sockets) (plSocket** sockets, bool* selectedSockets, uint32_t socketCount, uint32_t timeOutMilliSec); plOSResult (*connect_socket) (plSocket*, plNetworkAddress*); plOSResult (*listen_socket) (plSocket*); - plOSResult (*accept_socket) (plSocket*, plSocket** pptSocketOut); - plOSResult (*get_socket_data) (plSocket*, void* pOutData, size_t, size_t* pszRecievedSize); - plOSResult (*send_socket_data)(plSocket*, void* pData, size_t, size_t* pszSentSizeOut); + plOSResult (*accept_socket) (plSocket*, plSocket** socketPtrOut); + plOSResult (*get_socket_data) (plSocket*, void* dataOut, size_t, size_t* recievedPtrSize); + plOSResult (*send_socket_data)(plSocket*, void* data, size_t, size_t* sentPtrSizeOut); } plNetworkI; @@ -149,47 +149,47 @@ typedef struct _plThreadsI { // threads - plOSResult (*create_thread) (plThreadProcedure, void* pData, plThread** ppThreadOut); - void (*destroy_thread)(plThread** ppThread); + plOSResult (*create_thread) (plThreadProcedure, void* data, plThread** threadPtrOut); + void (*destroy_thread)(plThread** threadPtr); void (*join_thread) (plThread*); uint32_t (*get_thread_id) (plThread*); void (*yield_thread) (void); - void (*sleep_thread) (uint32_t uMilliSec); + void (*sleep_thread) (uint32_t milliSec); uint32_t (*get_hardware_thread_count)(void); // thread local storage - plOSResult (*allocate_thread_local_key) (plThreadKey** pptKeyOut); - void (*free_thread_local_key) (plThreadKey** pptKey); - void* (*allocate_thread_local_data)(plThreadKey*, size_t szSize); - void (*free_thread_local_data) (plThreadKey*, void* pData); + plOSResult (*allocate_thread_local_key) (plThreadKey** keyPtrOut); + void (*free_thread_local_key) (plThreadKey** keyPtr); + void* (*allocate_thread_local_data)(plThreadKey*, size_t); + void (*free_thread_local_data) (plThreadKey*, void* data); void* (*get_thread_local_data) (plThreadKey*); // mutexes - plOSResult (*create_mutex) (plMutex** ppMutexOut); - void (*destroy_mutex)(plMutex** pptMutex); + plOSResult (*create_mutex) (plMutex** mutexPtrOut); + void (*destroy_mutex)(plMutex** mutexPtr); void (*lock_mutex) (plMutex*); void (*unlock_mutex) (plMutex*); // critical sections - plOSResult (*create_critical_section) (plCriticalSection** pptCriticalSectionOut); + plOSResult (*create_critical_section) (plCriticalSection** criticalSectionPtrOut); void (*destroy_critical_section)(plCriticalSection**); void (*enter_critical_section) (plCriticalSection*); void (*leave_critical_section) (plCriticalSection*); // semaphores - plOSResult (*create_semaphore) (uint32_t uIntialCount, plSemaphore** pptSemaphoreOut); + plOSResult (*create_semaphore) (uint32_t intialCount, plSemaphore** semaphorePtrOut); void (*destroy_semaphore) (plSemaphore**); void (*wait_on_semaphore) (plSemaphore*); bool (*try_wait_on_semaphore)(plSemaphore*); void (*release_semaphore) (plSemaphore*); // barriers - plOSResult (*create_barrier) (uint32_t uThreadCount, plBarrier** pptBarrierOut); - void (*destroy_barrier)(plBarrier** pptBarrier); + plOSResult (*create_barrier) (uint32_t threadCount, plBarrier** barrierPtrOut); + void (*destroy_barrier)(plBarrier** barrierPtr); void (*wait_on_barrier)(plBarrier*); // condition variables - plOSResult (*create_condition_variable) (plConditionVariable** pptConditionVariableOut); + plOSResult (*create_condition_variable) (plConditionVariable** conditionVariablePtrOut); void (*destroy_condition_variable) (plConditionVariable**); void (*wake_condition_variable) (plConditionVariable*); void (*wake_all_condition_variable)(plConditionVariable*); @@ -200,11 +200,11 @@ typedef struct _plThreadsI typedef struct _plAtomicsI { - plOSResult (*create_atomic_counter) (int64_t ilValue, plAtomicCounter** pptCounterOut); + plOSResult (*create_atomic_counter) (int64_t value, plAtomicCounter** counterPtrOut); void (*destroy_atomic_counter) (plAtomicCounter**); - void (*atomic_store) (plAtomicCounter*, int64_t ilValue); + void (*atomic_store) (plAtomicCounter*, int64_t value); int64_t (*atomic_load) (plAtomicCounter*); - bool (*atomic_compare_exchange)(plAtomicCounter*, int64_t ilExpectedValue, int64_t ilDesiredValue); + bool (*atomic_compare_exchange)(plAtomicCounter*, int64_t expectedValue, int64_t desiredValue); int64_t (*atomic_increment) (plAtomicCounter*); int64_t (*atomic_decrement) (plAtomicCounter*); @@ -223,11 +223,11 @@ typedef struct _plVirtualMemoryI // evicted. It is up to the OS. size_t (*get_page_size)(void); // returns memory page size - void* (*alloc) (void* pAddress, size_t); // reserves & commits a block of memory. pAddress is starting address or use NULL to have system choose. szSize must be a multiple of memory page size. - void* (*reserve) (void* pAddress, size_t); // reserves a block of memory. pAddress is starting address or use NULL to have system choose. szSize must be a multiple of memory page size. - void* (*commit) (void* pAddress, size_t); // commits a block of reserved memory. szSize must be a multiple of memory page size. - void (*uncommit) (void* pAddress, size_t); // uncommits a block of committed memory. - void (*free) (void* pAddress, size_t); // frees a block of previously reserved/committed memory. Must be the starting address returned from "reserve()" or "alloc()" + void* (*alloc) (void* address, size_t); // reserves & commits a block of memory. pAddress is starting address or use NULL to have system choose. szSize must be a multiple of memory page size. + void* (*reserve) (void* address, size_t); // reserves a block of memory. pAddress is starting address or use NULL to have system choose. szSize must be a multiple of memory page size. + void* (*commit) (void* address, size_t); // commits a block of reserved memory. szSize must be a multiple of memory page size. + void (*uncommit) (void* address, size_t); // uncommits a block of committed memory. + void (*free) (void* address, size_t); // frees a block of previously reserved/committed memory. Must be the starting address returned from "reserve()" or "alloc()" } plVirtualMemoryI;