mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -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;
|
||||
|
||||
protected override void OnRenderFrame( FrameEventArgs e ) {
|
||||
Graphics.BeginFrame( this );
|
||||
accumulator += e.Time;
|
||||
imageCheckAccumulator += e.Time;
|
||||
ticksAccumulator += e.Time;
|
||||
@ -253,7 +254,7 @@ namespace ClassicalSharp {
|
||||
Graphics.TakeScreenshot( path, ClientSize );
|
||||
screenshotRequested = false;
|
||||
}
|
||||
SwapBuffers();
|
||||
Graphics.EndFrame( this );
|
||||
}
|
||||
|
||||
void RenderPlayers( double deltaTime, float t ) {
|
||||
|
@ -386,6 +386,15 @@ namespace ClassicalSharp.GraphicsAPI {
|
||||
|
||||
#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 ) {
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
@ -191,6 +191,10 @@ namespace ClassicalSharp.GraphicsAPI {
|
||||
public virtual void PrintApiSpecificInfo() {
|
||||
}
|
||||
|
||||
public abstract void BeginFrame( Game game );
|
||||
|
||||
public abstract void EndFrame( Game game );
|
||||
|
||||
public abstract void OnWindowResize( int newWidth, int newHeight );
|
||||
|
||||
protected void InitDynamicBuffers() {
|
||||
|
@ -432,6 +432,13 @@ namespace ClassicalSharp.GraphicsAPI {
|
||||
}
|
||||
#endif
|
||||
|
||||
public override void BeginFrame( Game game ) {
|
||||
}
|
||||
|
||||
public override void EndFrame( Game game ) {
|
||||
game.SwapBuffers();
|
||||
}
|
||||
|
||||
public override void PrintApiSpecificInfo() {
|
||||
Console.WriteLine( "OpenGL vendor: " + GL.GetString( StringName.Vendor ) );
|
||||
Console.WriteLine( "OpenGL renderer: " + GL.GetString( StringName.Renderer ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user