Last changes

This commit is contained in:
SirLynix
2023-02-02 20:33:53 +01:00
committed by Jérôme Leclercq
parent cee75dcc11
commit 5a57aca66a
26 changed files with 310 additions and 183 deletions

View File

@@ -78,7 +78,6 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLch
cb(glCreateProgram, PFNGLCREATEPROGRAMPROC) \
cb(glCreateShader, PFNGLCREATESHADERPROC) \
cb(glCullFace, PFNGLCULLFACEPROC) \
cb(glDebugMessageControl, PFNGLDEBUGMESSAGECONTROLPROC) \
cb(glDeleteBuffers, PFNGLDELETEBUFFERSPROC) \
cb(glDeleteFramebuffers, PFNGLDELETEFRAMEBUFFERSPROC) \
cb(glDeleteProgram, PFNGLDELETEPROGRAMPROC) \
@@ -118,7 +117,6 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLch
cb(glGetActiveUniformBlockiv, PFNGLGETACTIVEUNIFORMBLOCKIVPROC) \
cb(glGetActiveUniformBlockName, PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) \
cb(glGetBooleanv, PFNGLGETBOOLEANVPROC) \
cb(glGetBooleani_v, PFNGLGETBOOLEANI_VPROC) \
cb(glGetBufferParameteriv, PFNGLGETBUFFERPARAMETERIVPROC) \
cb(glGetError, PFNGLGETERRORPROC) \
cb(glGetFloatv, PFNGLGETFLOATVPROC) \
@@ -196,10 +194,12 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLch
cb(glVertexAttribPointer, PFNGLVERTEXATTRIBPOINTERPROC) \
cb(glViewport, PFNGLVIEWPORTPROC) \
/* Core OpenGL (extension in OpenGL ES) */ \
extCb(glDebugMessageControl, PFNGLDEBUGMESSAGECONTROLPROC) \
extCb(glDrawBuffer, PFNGLDRAWBUFFERPROC) \
extCb(glPolygonMode, PFNGLPOLYGONMODEPROC) \
/* OpenGL 4.2 - OpenGL ES 3.1 */\
extCb(glBindImageTexture, PFNGLBINDIMAGETEXTUREPROC) \
extCb(glGetBooleani_v, PFNGLGETBOOLEANI_VPROC) \
extCb(glMemoryBarrier, PFNGLMEMORYBARRIERPROC) \
extCb(glMemoryBarrierByRegion, PFNGLMEMORYBARRIERBYREGIONPROC) \
/* OpenGL 4.3 - OpenGL ES 3.1 */\

View File

@@ -19,8 +19,8 @@ namespace Nz
Cocoa,
X11,
Wayland,
Windows,
Web
Web,
Windows
};
struct WindowHandle

View File

@@ -34,7 +34,6 @@
#include <Nazara/Utility/AbstractTextDrawer.hpp>
#include <Nazara/Utility/Algorithm.hpp>
#include <Nazara/Utility/Animation.hpp>
#include <Nazara/Utility/BasicMainloop.hpp>
#include <Nazara/Utility/Buffer.hpp>
#include <Nazara/Utility/BufferMapper.hpp>
#include <Nazara/Utility/Config.hpp>

View File

@@ -1,43 +0,0 @@
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_UTILITY_BASICMAINLOOP_HPP
#define NAZARA_UTILITY_BASICMAINLOOP_HPP
#include <Nazara/Platform/Window.hpp>
#ifdef NAZARA_PLATFORM_WEB
#include <emscripten/html5.h>
#endif
namespace Nz
{
template <typename CallbackT>
void BasicMainloop(Window& window, CallbackT&& callback)
{
#ifndef NAZARA_PLATFORM_WEB
while (window.IsOpen())
{
callback();
}
#else
emscripten_set_main_loop_arg([] (void* callbackInstance)
{
try
{
(*static_cast<decltype(&callback)>(callbackInstance))();
}
catch(std::exception e)
{
NazaraDebug(e.what());
}
}, &callback, 0, 1);
#endif
}
}
#endif // NAZARA_UTILITY_BASICMAINLOOP_HPP