Quellcode durchsuchen

Added CopyPixmap.

Mark Sibly vor 9 Jahren
Ursprung
Commit
4bf7a1b3bc
1 geänderte Dateien mit 11 neuen und 0 gelöschten Zeilen
  1. 11 0
      modules/mojo/graphics/device.monkey2

+ 11 - 0
modules/mojo/graphics/device.monkey2

@@ -209,6 +209,17 @@ Class GraphicsDevice
 		
 		_modified=True
 	End
+	
+	Method CopyPixmap:Pixmap( rect:Recti )
+	
+		Validate()
+
+		Local pixmap:=New Pixmap( rect.Width,rect.Height,PixelFormat.RGBA32 )
+		
+		glReadPixels( rect.X,rect.Y,rect.Width,rect.Height,GL_RGBA,GL_UNSIGNED_BYTE,pixmap.Data )
+		
+		Return pixmap
+	End
 
 	Private