-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
569 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule SPIRV-Cross
added at
b8e742
Submodule VulkanMemoryAllocator
added at
9b0fc3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,62 @@ | ||
#include <concepts> | ||
#include <iostream> | ||
#include <list> | ||
#include <type_traits> | ||
|
||
template<typename T, typename ... U> | ||
concept IsAnyOf = (std::same_as<T, U> || ...); | ||
|
||
template<typename T> | ||
concept IsPrintable = std::integral<T> || std::floating_point<T> || | ||
IsAnyOf<std::remove_cvref_t<std::remove_pointer_t<std::decay_t<T>>>, char, wchar_t>; | ||
|
||
void println(IsPrintable auto const ... arguments) | ||
struct A_Test | ||
{ | ||
(std::wcout << ... << arguments) << '\n'; | ||
} | ||
|
||
int main() { println("Example: ", 3.14, " : ", 42, " : [", 'a', L'-', L"Z]"); } | ||
}; | ||
|
||
template <typename T> | ||
class TestUniformBuffer | ||
{ | ||
private: | ||
uint32_t testValue; | ||
|
||
public: | ||
struct Descriptor | ||
{ | ||
uint32_t testValue; | ||
}; | ||
|
||
void Create(const std::string &name, const Descriptor &descriptor, void *allocator) | ||
{ | ||
this->testValue = descriptor.testValue; | ||
std::cout << "Size:" << sizeof(T) << std::endl; | ||
} | ||
|
||
uint32_t GetValue() const | ||
{ | ||
return this->testValue; | ||
} | ||
}; | ||
|
||
class TestContext | ||
{ | ||
public: | ||
template <typename T> | ||
void BindingTestUniformBuffer(const TestUniformBuffer<T> &tub) | ||
{ | ||
std::cout << "Value:" << tub.GetValue() << std::endl; | ||
} | ||
}; | ||
|
||
int main() | ||
{ | ||
std::cout << "Hello World" << std::endl; | ||
|
||
bool is_class = std::is_class_v<A_Test>; | ||
std::cout << is_class << ":A_Test" << std::endl; | ||
|
||
struct B_Test | ||
{ | ||
float test; | ||
uint16_t uint16_t_test; | ||
double double_test; | ||
}; | ||
|
||
TestUniformBuffer<B_Test> test_buffer; | ||
test_buffer.Create("test uniform bffer", {123}, nullptr); | ||
|
||
TestContext tc; | ||
tc.BindingTestUniformBuffer(test_buffer); | ||
} |
Oops, something went wrong.