stk-code_catmod/lib/graphics_engine/include/ge_main.hpp

52 lines
1.2 KiB
C++
Raw Normal View History

#ifndef HEADER_GE_MAIN_HPP
#define HEADER_GE_MAIN_HPP
#include <IVideoDriver.h>
2022-07-18 01:28:07 -04:00
#include <matrix4.h>
2022-05-26 21:41:34 -04:00
#include <cstdint>
2022-03-18 04:24:33 -04:00
#include <string>
#include <unordered_set>
namespace GE
{
2022-03-01 00:22:20 -05:00
class GEVulkanDriver;
struct GEConfig
{
bool m_disable_npot_texture;
2022-07-24 21:41:35 -04:00
bool m_convert_irrlicht_mesh;
2022-08-05 21:48:11 -04:00
bool m_texture_compression;
bool m_vulkan_fullscreen_desktop;
std::unordered_set<std::string> m_ondemand_load_texture_paths;
2022-08-27 00:49:17 -04:00
float m_render_scale;
};
2022-03-18 04:24:33 -04:00
void setVideoDriver(irr::video::IVideoDriver* driver);
void setShaderFolder(const std::string& path);
irr::video::IVideoDriver* getDriver();
2022-03-01 00:22:20 -05:00
GE::GEVulkanDriver* getVKDriver();
2022-03-18 04:24:33 -04:00
const std::string& getShaderFolder();
GEConfig* getGEConfig();
void deinit();
2022-05-26 21:41:34 -04:00
uint64_t getMonoTimeMs();
2022-07-18 01:28:07 -04:00
void mathPlaneFrustumf(float* out, const irr::core::matrix4& pvm);
2022-07-24 02:32:37 -04:00
inline size_t getPadding(size_t in, size_t alignment)
{
if (in == 0 || alignment == 0)
return 0;
size_t mod = in % alignment;
if (mod == 0)
return 0;
else
return alignment - mod;
}
2022-08-05 21:48:11 -04:00
inline int get4x4CompressedTextureSize(int width, int height)
{
int blockcount = ((width + 3) / 4) * ((height + 3) / 4);
int blocksize = 4 * 4;
return blockcount * blocksize;
}
2022-08-05 21:48:11 -04:00
}
#endif