Avoid name conflicts between Util and Windows function

GetWindow and SwapBuffers are function of Windows.h and using the same
name causes a compile error.

This commit also changes Util's GetProcTableAndDevice to CreateNXTDevice
because we might need to call NXT procs when creating the C++ device.
This commit is contained in:
Corentin Wallez
2017-05-29 11:30:29 -07:00
committed by Corentin Wallez
parent 26275d0a16
commit 583e9a8f3c
13 changed files with 71 additions and 87 deletions

View File

@@ -16,7 +16,6 @@
#include <cstdlib>
#include <cstdio>
#include <unistd.h>
#include <vector>
nxt::Device device;
@@ -42,9 +41,7 @@ struct ShaderData {
static std::vector<ShaderData> shaderData;
void init() {
nxtProcTable procs;
GetProcTableAndDevice(&procs, &device);
nxtSetProcs(&procs);
device = CreateCppNXTDevice();
queue = device.CreateQueueBuilder().GetResult();
@@ -150,7 +147,7 @@ void frame() {
}
queue.Submit(50, commands.data());
SwapBuffers();
DoSwapBuffers();
fprintf(stderr, "frame %i\n", f);
}
@@ -162,7 +159,7 @@ int main(int argc, const char* argv[]) {
while (!ShouldQuit()) {
frame();
usleep(16000);
USleep(16000);
}
// TODO release stuff