mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Cleanup.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "dbg.h"
|
||||
#include "cmd.h"
|
||||
#include "entry.h" //TinyStlCustomAllocator
|
||||
#include "entry_p.h"
|
||||
|
||||
#include <tinystl/allocator.h>
|
||||
#include <tinystl/string.h>
|
||||
|
||||
@@ -451,6 +451,19 @@ namespace entry
|
||||
return &s_allocator;
|
||||
}
|
||||
|
||||
void* TinyStlAllocator::static_allocate(size_t _bytes)
|
||||
{
|
||||
return BX_ALLOC(getAllocator(), _bytes);
|
||||
}
|
||||
|
||||
void TinyStlAllocator::static_deallocate(void* _ptr, size_t /*_bytes*/)
|
||||
{
|
||||
if (NULL != _ptr)
|
||||
{
|
||||
BX_FREE(getAllocator(), _ptr);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace entry
|
||||
|
||||
extern "C" bool entry_process_events(uint32_t* _width, uint32_t* _height, uint32_t* _debug, uint32_t* _reset)
|
||||
|
||||
@@ -18,20 +18,6 @@ extern "C" int _main_(int _argc, char** _argv);
|
||||
#define ENTRY_WINDOW_FLAG_ASPECT_RATIO UINT32_C(0x00000001)
|
||||
#define ENTRY_WINDOW_FLAG_FRAME UINT32_C(0x00000002)
|
||||
|
||||
// For a custom tinystl allocator, define this and implement TinyStlCustomAllocator somewhere in the project.
|
||||
#ifndef ENTRY_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR
|
||||
# define ENTRY_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR 0
|
||||
#endif // ENTRY_CONFIG_USE_TINYSTL
|
||||
|
||||
#if ENTRY_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR
|
||||
struct TinyStlCustomAllocator
|
||||
{
|
||||
static void* static_allocate(size_t _bytes);
|
||||
static void static_deallocate(void* _ptr, size_t /*_bytes*/);
|
||||
};
|
||||
# define TINYSTL_ALLOCATOR TinyStlCustomAllocator
|
||||
#endif //ENTRY_CONFIG_USE_TINYSTL_CUSTOM_ALLOCATOR
|
||||
|
||||
namespace entry
|
||||
{
|
||||
struct WindowHandle { uint16_t idx; };
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#ifndef ENTRY_PRIVATE_H_HEADER_GUARD
|
||||
#define ENTRY_PRIVATE_H_HEADER_GUARD
|
||||
|
||||
#define TINYSTL_ALLOCATOR entry::TinyStlAllocator
|
||||
|
||||
#include <bx/spscqueue.h>
|
||||
|
||||
#include "entry.h"
|
||||
@@ -42,6 +44,12 @@
|
||||
|
||||
namespace entry
|
||||
{
|
||||
struct TinyStlAllocator
|
||||
{
|
||||
static void* static_allocate(size_t _bytes);
|
||||
static void static_deallocate(void* _ptr, size_t /*_bytes*/);
|
||||
};
|
||||
|
||||
int main(int _argc, char** _argv);
|
||||
|
||||
struct Event
|
||||
|
||||
Reference in New Issue
Block a user