You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/SDL2.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Create GL Context if using OpenGL
36
36
// Check if succeeded, etc.
37
37
```
38
38
39
-
If necessary, get a handle to the platform's native window, then setting it in the Diligent NativeWindow struct. Example for Windows:
39
+
If necessary, get a handle to the platform's native window, then set it in the Diligent NativeWindow struct. Example for Windows:
40
40
```cpp
41
41
SDL_SysWMinfo info;
42
42
SDL_VERSION(&info.version);
@@ -56,30 +56,30 @@ while (true)
56
56
{
57
57
while (SDL_PollEvent(&event))
58
58
{
59
-
switch(event.type)
59
+
switch(event.type)
60
60
{
61
-
case SDL_WINDOWEVENT:
62
-
{
63
-
switch(event.window.event)
64
-
{
65
-
case SDL_WINDOWEVENT_FOCUS_LOST:
66
-
{
67
-
// Suspend or destroy swapchain
68
-
break;
69
-
}
70
-
case SDL_WINDOWEVENT_FOCUS_GAINED:
61
+
case SDL_WINDOWEVENT:
71
62
{
72
-
// Resume or recreate swapchain
63
+
switch (event.window.event)
64
+
{
65
+
case SDL_WINDOWEVENT_FOCUS_LOST:
66
+
{
67
+
// Suspend or destroy swapchain
68
+
break;
69
+
}
70
+
case SDL_WINDOWEVENT_FOCUS_GAINED:
71
+
{
72
+
// Resume or recreate swapchain
73
+
break;
74
+
}
75
+
case SDL_WINDOWEVENT_RESIZED:
76
+
{
77
+
// Handle window resize
78
+
break;
79
+
}
80
+
}
73
81
break;
74
82
}
75
-
case SDL_WINDOWEVENT_RESIZED:
76
-
{
77
-
// Handle window resize
78
-
break;
79
-
}
80
-
}
81
-
break;
82
-
}
83
83
}
84
84
}
85
85
}
@@ -93,7 +93,7 @@ auto window = SDL_CreateWindow(window_title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOW
93
93
```
94
94
95
95
96
-
Copy [SurfaceHelper.mm](https://github.com/DiligentGraphics/DiligentSamples/blob/9be93225a7fdf135583146c1175c232217f310b2/Samples/GLFWDemo/src/SurfaceHelper.mm) file from the GLFW sample into your project.
96
+
Copy [SurfaceHelper.mm](https://github.com/DiligentGraphics/DiligentSamples/blob/master/Samples/GLFWDemo/src/SurfaceHelper.mm) file from the GLFW sample into your project.
Use the helper function to get the NSWindowView, setting it in the NativeWindow struct. Then create the vulkan swapchain as normal.
131
+
Use the helper function to get the NSWindowView, setting it in the NativeWindow struct. Then create the Vulkan swapchain as normal.
132
132
133
133
## Android
134
134
135
135
### Project template
136
136
137
-
Follow the [official documentation for setting up an android project](https://github.com/libsdl-org/SDL/blob/7fdf7943774d2a54e48718316ca6d55d51a37696/docs/README-android.md) for SDL2.
137
+
Follow the [official documentation for setting up an android project](https://github.com/libsdl-org/SDL/blob/main/docs/README-android.md) for SDL2.
138
138
139
139
#### Optional: Handle devices with screen notch in your derived SDLActivity class:
140
140
```java
@@ -266,7 +266,7 @@ Set the Vulkan and fullscreen / resizable window flags when creating the window.
Then create the swapchain as normal. Keep the swapchain description used.
269
+
Then create the swapchain as normal. Keep the swapchain description to be used.
270
270
```cpp
271
271
auto *pFactoryVk = GetEngineFactoryVk();
272
272
@@ -303,7 +303,7 @@ if (device->GetDeviceInfo().IsVulkanDevice())
303
303
304
304
### OpenGLES
305
305
306
-
Set the attributes Diligent wants, set the opengl and fullscreen / resizable window flags, create the window, create the context, and finally create the swapchain
306
+
Set the attributes Diligent expects, set the OpenGL and fullscreen / resizable window flags, create the window, create the context, and finally create the swapchain
0 commit comments