diff options
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); } } |