summaryrefslogtreecommitdiffstats
path: root/src/skel/glfw/glfw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/skel/glfw/glfw.cpp')
-rw-r--r--src/skel/glfw/glfw.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index a1170c61..920bb8a9 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -181,6 +181,22 @@ psCameraShowRaster(RwCamera *camera)
return;
}
+/*
+ *****************************************************************************
+ */
+RwImage *
+psGrabScreen(RwCamera *pCamera)
+{
+#ifndef LIBRW
+ RwRaster *pRaster = RwCameraGetRaster(pCamera);
+ if (RwImage *pImage = RwImageCreate(pRaster->width, pRaster->height, 32)) {
+ RwImageAllocatePixels(pImage);
+ RwImageSetFromRaster(pImage, pRaster);
+ return pImage;
+ }
+#endif
+ return nil;
+}
/*
*****************************************************************************
@@ -209,7 +225,11 @@ double
psTimer(void)
{
struct timespec start;
+#ifdef __linux__
clock_gettime(CLOCK_MONOTONIC_RAW, &start);
+#else
+ clock_gettime(CLOCK_MONOTONIC, &start);
+#endif
return start.tv_sec * 1000.0 + start.tv_nsec/1000000.0;
}
#endif