mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 21:49:19 +02:00
fixes for gles mode
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "query.h"
|
||||
#include "Globals.h"
|
||||
|
||||
gl::query::query(targets target)
|
||||
: target(target)
|
||||
@@ -35,9 +36,13 @@ std::optional<int64_t> gl::query::result()
|
||||
{
|
||||
GLuint ready;
|
||||
glGetQueryObjectuiv(*this, GL_QUERY_RESULT_AVAILABLE, &ready);
|
||||
int64_t value;
|
||||
int64_t value = 0;
|
||||
if (ready) {
|
||||
glGetQueryObjecti64v(*this, GL_QUERY_RESULT, &value);
|
||||
if (!Global.gfx_usegles)
|
||||
glGetQueryObjecti64v(*this, GL_QUERY_RESULT, &value);
|
||||
else
|
||||
glGetQueryObjectuiv(*this, GL_QUERY_RESULT, reinterpret_cast<GLuint*>(&value));
|
||||
|
||||
return std::optional<int64_t>(value);
|
||||
}
|
||||
return std::nullopt;
|
||||
|
||||
Reference in New Issue
Block a user