mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Metal example code cleanup
This commit is contained in:
parent
8eb2345347
commit
70297aeb49
@ -24,16 +24,15 @@
|
|||||||
//========================================================================
|
//========================================================================
|
||||||
//! [code]
|
//! [code]
|
||||||
|
|
||||||
#import <Metal/Metal.h>
|
|
||||||
#import <QuartzCore/QuartzCore.h>
|
|
||||||
#import <simd/simd.h>
|
|
||||||
|
|
||||||
#define GLFW_INCLUDE_NONE
|
#define GLFW_INCLUDE_NONE
|
||||||
#import <GLFW/glfw3.h>
|
#import <GLFW/glfw3.h>
|
||||||
#define GLFW_EXPOSE_NATIVE_COCOA
|
#define GLFW_EXPOSE_NATIVE_COCOA
|
||||||
#define GLFW_EXPOSE_NATIVE_NSGL
|
|
||||||
#import <GLFW/glfw3native.h>
|
#import <GLFW/glfw3native.h>
|
||||||
|
|
||||||
|
#import <Metal/Metal.h>
|
||||||
|
#import <QuartzCore/QuartzCore.h>
|
||||||
|
#import <simd/simd.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -53,11 +52,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
|
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
|
||||||
if (!device)
|
if (!device)
|
||||||
{
|
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
|
||||||
|
|
||||||
GLFWwindow* window;
|
|
||||||
|
|
||||||
glfwSetErrorCallback(error_callback);
|
glfwSetErrorCallback(error_callback);
|
||||||
|
|
||||||
@ -65,7 +60,7 @@ int main(void)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
||||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
|
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
|
||||||
window = glfwCreateWindow(640, 480, "Metal Example", NULL, NULL);
|
GLFWwindow* window = glfwCreateWindow(640, 480, "Metal Example", NULL, NULL);
|
||||||
if (!window)
|
if (!window)
|
||||||
{
|
{
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
|
Loading…
Reference in New Issue
Block a user