mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 18:15:28 -04:00
Added BeginFrame/EndFrame to IGraphicsApi.
This commit is contained in:
parent
bdd41a8f24
commit
e395eae957
@ -179,6 +179,7 @@ namespace ClassicalSharp {
|
|||||||
double ticksAccumulator = 0, imageCheckAccumulator = 0;
|
double ticksAccumulator = 0, imageCheckAccumulator = 0;
|
||||||
|
|
||||||
protected override void OnRenderFrame( FrameEventArgs e ) {
|
protected override void OnRenderFrame( FrameEventArgs e ) {
|
||||||
|
Graphics.BeginFrame( this );
|
||||||
accumulator += e.Time;
|
accumulator += e.Time;
|
||||||
imageCheckAccumulator += e.Time;
|
imageCheckAccumulator += e.Time;
|
||||||
ticksAccumulator += e.Time;
|
ticksAccumulator += e.Time;
|
||||||
@ -253,7 +254,7 @@ namespace ClassicalSharp {
|
|||||||
Graphics.TakeScreenshot( path, ClientSize );
|
Graphics.TakeScreenshot( path, ClientSize );
|
||||||
screenshotRequested = false;
|
screenshotRequested = false;
|
||||||
}
|
}
|
||||||
SwapBuffers();
|
Graphics.EndFrame( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderPlayers( double deltaTime, float t ) {
|
void RenderPlayers( double deltaTime, float t ) {
|
||||||
|
@ -386,6 +386,15 @@ namespace ClassicalSharp.GraphicsAPI {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public override void BeginFrame( Game game ) {
|
||||||
|
device.BeginScene();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void EndFrame( Game game ) {
|
||||||
|
device.EndScene();
|
||||||
|
device.Present();
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnWindowResize( int newWidth, int newHeight ) {
|
public override void OnWindowResize( int newWidth, int newHeight ) {
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
}
|
}
|
||||||
|
@ -191,6 +191,10 @@ namespace ClassicalSharp.GraphicsAPI {
|
|||||||
public virtual void PrintApiSpecificInfo() {
|
public virtual void PrintApiSpecificInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract void BeginFrame( Game game );
|
||||||
|
|
||||||
|
public abstract void EndFrame( Game game );
|
||||||
|
|
||||||
public abstract void OnWindowResize( int newWidth, int newHeight );
|
public abstract void OnWindowResize( int newWidth, int newHeight );
|
||||||
|
|
||||||
protected void InitDynamicBuffers() {
|
protected void InitDynamicBuffers() {
|
||||||
|
@ -432,6 +432,13 @@ namespace ClassicalSharp.GraphicsAPI {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
public override void BeginFrame( Game game ) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void EndFrame( Game game ) {
|
||||||
|
game.SwapBuffers();
|
||||||
|
}
|
||||||
|
|
||||||
public override void PrintApiSpecificInfo() {
|
public override void PrintApiSpecificInfo() {
|
||||||
Console.WriteLine( "OpenGL vendor: " + GL.GetString( StringName.Vendor ) );
|
Console.WriteLine( "OpenGL vendor: " + GL.GetString( StringName.Vendor ) );
|
||||||
Console.WriteLine( "OpenGL renderer: " + GL.GetString( StringName.Renderer ) );
|
Console.WriteLine( "OpenGL renderer: " + GL.GetString( StringName.Renderer ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user