diff options
author | 2015-09-12 10:23:53 +0200 | |
---|---|---|
committer | 2015-09-12 10:23:53 +0200 | |
commit | 7ca8f88a5c399317265d9a2f5132eab2ab7723ac (patch) | |
tree | cf7af75fb307bd040508c4c2455d3bd6755619f4 /3rdparty/bgfx/examples/07-callback/callback.cpp | |
parent | 6d06509293e2fe6b1743085471f0ff5268a1b351 (diff) |
Added latest BGFX (nw)
Diffstat (limited to '3rdparty/bgfx/examples/07-callback/callback.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/07-callback/callback.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/3rdparty/bgfx/examples/07-callback/callback.cpp b/3rdparty/bgfx/examples/07-callback/callback.cpp index 3caec753fed..fa0b0329d88 100644 --- a/3rdparty/bgfx/examples/07-callback/callback.cpp +++ b/3rdparty/bgfx/examples/07-callback/callback.cpp @@ -136,10 +136,16 @@ struct BgfxCallback : public bgfx::CallbackI abort(); } + virtual void traceVargs(const char* _filePath, uint16_t _line, const char* _format, va_list _argList) BX_OVERRIDE + { + dbgPrintf("%s (%d): ", _filePath, _line); + dbgPrintfVargs(_format, _argList); + } + virtual uint32_t cacheReadSize(uint64_t _id) BX_OVERRIDE { char filePath[256]; - bx::snprintf(filePath, sizeof(filePath), "%016" PRIx64, _id); + bx::snprintf(filePath, sizeof(filePath), "temp/%016" PRIx64, _id); // Use cache id as filename. FILE* file = fopen(filePath, "rb"); @@ -417,7 +423,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) { // This dummy draw call is here to make sure that view 0 is cleared // if no other draw calls are submitted to view 0. - bgfx::submit(0); + bgfx::touch(0); int64_t now = bx::getHPCounter(); static int64_t last = now; @@ -469,9 +475,6 @@ int _main_(int /*_argc*/, char** /*_argv*/) // Set model matrix for rendering. bgfx::setTransform(mtx); - // Set vertex and fragment shaders. - bgfx::setProgram(program); - // Set vertex and index buffer. bgfx::setVertexBuffer(vbh); bgfx::setIndexBuffer(ibh); @@ -480,7 +483,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::setState(BGFX_STATE_DEFAULT); // Submit primitive for rendering to view 0. - bgfx::submit(0); + bgfx::submit(0, program); } } |