Пример #1
0
int main( int argc, char **argv ) {
  ApiWithoutSecrets::OS::Window window;
  ApiWithoutSecrets::Tutorial03 tutorial03;

  // Window creation
  if( !window.Create( "03 - First Triangle" ) ) {
    return -1;
  }

  // Vulkan preparations and initialization
  if( !tutorial03.PrepareVulkan( window.GetParameters() ) ) {
    return -1;
  }

  // Tutorial 03
  if( !tutorial03.CreateRenderPass() ) {
    return -1;
  }
  if( !tutorial03.CreateFramebuffers() ) {
    return -1;
  }
  if( !tutorial03.CreatePipeline() ) {
    return -1;
  }
  if( !tutorial03.CreateSemaphores() ) {
    return -1;
  }
  if( !tutorial03.CreateCommandBuffers() ) {
    return -1;
  }
  if( !tutorial03.RecordCommandBuffers() ) {
    return -1;
  }

  // Rendering loop
  if( !window.RenderingLoop( tutorial03 ) ) {
    return -1;
  }

  return 0;
}
Пример #2
0
int main( int argc, char **argv ) {
  ApiWithoutSecrets::OS::Window window;
  ApiWithoutSecrets::Tutorial05 tutorial05;

  // Window creation
  if( !window.Create( "05 - Staging Resources" ) ) {
    return -1;
  }

  // Vulkan preparations and initialization
  if( !tutorial05.PrepareVulkan( window.GetParameters() ) ) {
    return -1;
  }

  // Tutorial 05
  if( !tutorial05.CreateRenderPass() ) {
    return -1;
  }
  if( !tutorial05.CreatePipeline() ) {
    return -1;
  }
  if( !tutorial05.CreateRenderingResources() ) {
    return -1;
  }
  if( !tutorial05.CreateVertexBuffer() ) {
    return -1;
  }
  if( !tutorial05.CreateStagingBuffer() ) {
    return -1;
  }
  if( !tutorial05.CopyVertexData() ) {
    return -1;
  }

  // Rendering loop
  if( !window.RenderingLoop( tutorial05 ) ) {
    return -1;
  }

  return 0;
}
Пример #3
0
int main( int argc, char **argv ) {
  ApiWithoutSecrets::OS::Window window;
  ApiWithoutSecrets::Tutorial01 tutorial01;

  // Window creation
  if( !window.Create( "01 - The Beginning" ) ) {
    return -1;
  }

  // Vulkan preparations and initialization
  if( !tutorial01.PrepareVulkan() ) {
    return -1;
  }

  // Rendering loop
  if( !window.RenderingLoop( tutorial01 ) ) {
    return -1;
  }

  return 0;
}