mirror of
https://github.com/digarok/gsplus.git
synced 2025-02-20 02:28:57 +00:00
fps testing for win comparison
This commit is contained in:
parent
99c51da6e8
commit
a509cc0a3c
@ -5,6 +5,9 @@
|
||||
See LICENSE.txt for license (GPL v2)
|
||||
*/
|
||||
|
||||
// fps shiz
|
||||
unsigned int lastTime = 0, currentTime, frames;
|
||||
|
||||
// @todo: mouse clip bugs.. great western shootout. Paint 8/16. still in win32
|
||||
#include "SDL.h"
|
||||
#include "SDL_image.h"
|
||||
@ -381,6 +384,16 @@ void dev_video_init_sdl() {
|
||||
|
||||
// Copy a rect to our SDL window
|
||||
void sdl_push_kimage(Kimage *kimage_ptr, int destx, int desty, int srcx, int srcy, int width, int height) {
|
||||
// FPS shiz
|
||||
currentTime = SDL_GetTicks();
|
||||
if (currentTime > lastTime + 1000) {
|
||||
printf("FPS: %d\n", frames);
|
||||
frames = 0;
|
||||
lastTime = currentTime;
|
||||
}
|
||||
frames++;
|
||||
|
||||
|
||||
byte *src_ptr;
|
||||
int pixel_size = 4;
|
||||
src_ptr = kimage_ptr->data_ptr + (srcy * kimage_ptr->width_act + srcx) * pixel_size;
|
||||
|
Loading…
x
Reference in New Issue
Block a user