fix up some window behavior

refresh2
cosmonaut 2024-06-05 22:56:09 -07:00
parent 69ffbbf03a
commit d582bfe473
3 changed files with 12 additions and 4 deletions

View File

@ -17,6 +17,8 @@ class BasicComputeExample : Example
Window = window; Window = window;
GraphicsDevice = graphicsDevice; GraphicsDevice = graphicsDevice;
Window.SetTitle("BasicCompute");
// Create the compute pipeline that writes texture data // Create the compute pipeline that writes texture data
Shader fillTextureComputeShader = new Shader( Shader fillTextureComputeShader = new Shader(
GraphicsDevice, GraphicsDevice,

View File

@ -13,6 +13,8 @@ namespace MoonWorksGraphicsTests
Window = window; Window = window;
GraphicsDevice = graphicsDevice; GraphicsDevice = graphicsDevice;
Window.SetTitle("ClearScreen");
Window.SetPosition(SDL2.SDL.SDL_WINDOWPOS_CENTERED, SDL2.SDL.SDL_WINDOWPOS_CENTERED);
var (windowX, windowY) = Window.Position; var (windowX, windowY) = Window.Position;
Window.SetPosition(windowX - 360, windowY); Window.SetPosition(windowX - 360, windowY);
@ -66,6 +68,8 @@ namespace MoonWorksGraphicsTests
{ {
GraphicsDevice.UnclaimWindow(SecondaryWindow); GraphicsDevice.UnclaimWindow(SecondaryWindow);
SecondaryWindow.Dispose(); SecondaryWindow.Dispose();
Window.SetPosition(SDL2.SDL.SDL_WINDOWPOS_CENTERED, SDL2.SDL.SDL_WINDOWPOS_CENTERED);
} }
} }
} }

View File

@ -28,6 +28,8 @@ class CompressedTexturesExample : Example
GraphicsDevice = graphicsDevice; GraphicsDevice = graphicsDevice;
Inputs = inputs; Inputs = inputs;
Window.SetTitle("CompressedTextures");
Logger.LogInfo("Press Left and Right to cycle between textures"); Logger.LogInfo("Press Left and Right to cycle between textures");
Logger.LogInfo("Setting texture to: " + TextureNames[0]); Logger.LogInfo("Setting texture to: " + TextureNames[0]);
@ -72,10 +74,10 @@ class CompressedTexturesExample : Example
VertexBuffer = resourceUploader.CreateBuffer( VertexBuffer = resourceUploader.CreateBuffer(
[ [
new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 0)), new PositionTextureVertex(new Vector3(-1, 1, 0), new Vector2(0, 0)),
new PositionTextureVertex(new Vector3(1, -1, 0), new Vector2(1, 0)), new PositionTextureVertex(new Vector3( 1, 1, 0), new Vector2(1, 0)),
new PositionTextureVertex(new Vector3(1, 1, 0), new Vector2(1, 1)), new PositionTextureVertex(new Vector3( 1, -1, 0), new Vector2(1, 1)),
new PositionTextureVertex(new Vector3(-1, 1, 0), new Vector2(0, 1)) new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 1))
], ],
BufferUsageFlags.Vertex BufferUsageFlags.Vertex
); );