Ankush's Garage
A collection of stuff made by Ankush Roy
Loading...
Searching...
No Matches
Common.h
Go to the documentation of this file.
1#ifndef INCLUDE_COMMON_COMMON_H_
2#define INCLUDE_COMMON_COMMON_H_
3
4#include "Core/Common/pch.h"
5#include <expected>
6#include <string>
7
8#ifdef TRACY_ENABLE
9 #include <tracy/Tracy.hpp>
10 #define PROFILE_SCOPE ZoneScoped
11 #define PROFILE_SCOPE_N(name) ZoneScopedN(name)
12 #define PROFILE_FRAME FrameMark
13#else
14 #define PROFILE_SCOPE
15 #define PROFILE_SCOPE_N(name)
16 #define PROFILE_FRAME
17#endif
18
19namespace Common
20{
34std::expected<SDL_GPUShader *, std::string> LoadShader(SDL_GPUDevice *device,
35 const std::string &shaderFilename,
36 Uint32 samplerCount,
37 Uint32 uniformBufferCount,
38 Uint32 storageBufferCount,
39 Uint32 storageTextureCount);
40
42SDL_Surface *LoadImage(const std::string &imageFileName, int desiredChannels = 4);
43} // namespace Common
44
45#endif // INCLUDE_COMMON_COMMON_H_
Definition Common.cpp:6
SDL_Surface * LoadImage(const std::string &imageFileName, int desiredChannels)
Definition Common.cpp:106
std::expected< SDL_GPUShader *, std::string > LoadShader(SDL_GPUDevice *device, const std::string &shaderFilename, Uint32 samplerCount, Uint32 uniformBufferCount, Uint32 storageBufferCount, Uint32 storageTextureCount)
This is a function that returns a compiled shader after taking the path to shader.
Definition Common.cpp:37