Updated trace callback.

This commit is contained in:
Branimir Karadžić
2015-07-24 18:02:17 -07:00
parent 3cdf4beaa7
commit cb6cee9dd1
5 changed files with 22 additions and 24 deletions

View File

@@ -8,6 +8,7 @@
#ifndef BGFX_C99_H_HEADER_GUARD
#define BGFX_C99_H_HEADER_GUARD
#include <stdarg.h> // va_list
#include <stdbool.h> // bool
#include <stdint.h> // uint32_t
#include <stdlib.h> // size_t
@@ -367,7 +368,7 @@ typedef struct bgfx_callback_interface
typedef struct bgfx_callback_vtbl
{
void (*fatal)(bgfx_callback_interface_t* _this, bgfx_fatal_t _code, const char* _str);
void (*trace)(bgfx_callback_interface_t* _this, const char* _str);
void (*trace_vargs)(bgfx_callback_interface_t* _this, const char* _filePath, uint16_t _line, const char* _format, va_list _argList);
uint32_t (*cache_read_size)(bgfx_callback_interface_t* _this, uint64_t _id);
bool (*cache_read)(bgfx_callback_interface_t* _this, uint64_t _id, void* _data, uint32_t _size);
void (*cache_write)(bgfx_callback_interface_t* _this, uint64_t _id, const void* _data, uint32_t _size);

View File

@@ -6,6 +6,7 @@
#ifndef BGFX_H_HEADER_GUARD
#define BGFX_H_HEADER_GUARD
#include <stdarg.h> // va_list
#include <stdint.h> // uint32_t
#include <stdlib.h> // size_t
@@ -275,14 +276,18 @@ namespace bgfx
/// Print debug message.
///
/// @param[in] _str Message.
/// @param[in] _filePath File path where debug message was generated.
/// @param[in] _line Line where debug message was generated.
/// @param[in] _format `printf` style format.
/// @param[in] _argList Variable arguments list initialized with
/// `va_start`.
///
/// @remarks
/// Not thread safe and it can be called from any thread.
///
/// @attention C99 equivalent is `bgfx_callback_vtbl.trace`.
/// @attention C99 equivalent is `bgfx_callback_vtbl.trace_vargs`.
///
virtual void trace(const char* _str) = 0;
virtual void traceVargs(const char* _filePath, uint16_t _line, const char* _format, va_list _argList) = 0;
/// Return size of for cached item. Return 0 if no cached item was
/// found.