mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-29 19:47:30 +01:00
pch migration to modules [wip]
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
module;
|
||||
#include <string>
|
||||
#include <optional>
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
|
||||
export module eu07.global_include.interfaces.imaterial;
|
||||
import eu07.glm;
|
||||
import eu07.global_include.interfaces.itexture;
|
||||
|
||||
export {
|
||||
|
||||
|
||||
#include "ITexture.h"
|
||||
|
||||
struct IMaterial
|
||||
{
|
||||
@@ -57,4 +62,5 @@ struct IMaterial
|
||||
} null_material{};
|
||||
return &null_material;
|
||||
}
|
||||
};
|
||||
};
|
||||
} // export
|
||||
@@ -1,8 +1,15 @@
|
||||
#pragma once
|
||||
module;
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
|
||||
export module eu07.global_include.interfaces.itexture;
|
||||
|
||||
export {
|
||||
|
||||
typedef int texture_handle;
|
||||
|
||||
#define null_handle (0)
|
||||
|
||||
struct ITexture
|
||||
{
|
||||
@@ -73,4 +80,5 @@ struct ITexture
|
||||
} null_texture{};
|
||||
return &null_texture;
|
||||
}
|
||||
};
|
||||
};
|
||||
} // export
|
||||
8
global_include/interfaces/ITexture_macros.h
Normal file
8
global_include/interfaces/ITexture_macros.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// Macros cannot cross a module boundary, so they live in a plain header
|
||||
// that consumers pull into their global module fragment. The bodies are
|
||||
// expanded at the use site, where the imported names are in scope, so this
|
||||
// header deliberately includes nothing.
|
||||
|
||||
#define null_handle (0)
|
||||
Reference in New Issue
Block a user