mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 02:15:43 +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
@@ -14,8 +14,6 @@
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
nxtDevice device;
|
||||
nxtQueue queue;
|
||||
nxtPipeline pipeline;
|
||||
@@ -23,9 +21,7 @@ nxtRenderPass renderpass;
|
||||
nxtFramebuffer framebuffer;
|
||||
|
||||
void init() {
|
||||
nxtProcTable procs;
|
||||
GetProcTableAndDevice(&procs, &device);
|
||||
nxtSetProcs(&procs);
|
||||
device = CreateNXTDevice();
|
||||
|
||||
{
|
||||
nxtQueueBuilder builder = nxtDeviceCreateQueueBuilder(device);
|
||||
@@ -93,7 +89,7 @@ void frame() {
|
||||
nxtQueueSubmit(queue, 1, &commands);
|
||||
nxtCommandBufferRelease(commands);
|
||||
|
||||
SwapBuffers();
|
||||
DoSwapBuffers();
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
@@ -104,7 +100,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