mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 15:16:16 +00:00
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:
committed by
Corentin Wallez
parent
26275d0a16
commit
583e9a8f3c
@@ -17,7 +17,6 @@
|
||||
#include <array>
|
||||
#include <cstring>
|
||||
#include <random>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
@@ -296,9 +295,7 @@ void initCommandBuffers() {
|
||||
}
|
||||
|
||||
void init() {
|
||||
nxtProcTable procs;
|
||||
GetProcTableAndDevice(&procs, &device);
|
||||
nxtSetProcs(&procs);
|
||||
device = CreateCppNXTDevice();
|
||||
|
||||
queue = device.CreateQueueBuilder().GetResult();
|
||||
|
||||
@@ -310,7 +307,7 @@ void init() {
|
||||
|
||||
void frame() {
|
||||
queue.Submit(1, &commandBuffers[pingpong]);
|
||||
SwapBuffers();
|
||||
DoSwapBuffers();
|
||||
|
||||
pingpong = (pingpong + 1) % 2;
|
||||
}
|
||||
@@ -323,7 +320,7 @@ int main(int argc, const char* argv[]) {
|
||||
|
||||
while (!ShouldQuit()) {
|
||||
frame();
|
||||
usleep(16000);
|
||||
USleep(16000);
|
||||
}
|
||||
|
||||
// TODO release stuff
|
||||
|
||||
Reference in New Issue
Block a user