-
Notifications
You must be signed in to change notification settings - Fork 2
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
3 changed files
with
58 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* @file shader.hpp | ||
* @date 11/2/24 | ||
* @brief | ||
* | ||
* @copyright Copyright (c) 2024 Ruixiang Du (rdu) | ||
*/ | ||
|
||
#ifndef XMOTION_SHADER_HPP | ||
#define XMOTION_SHADER_HPP | ||
|
||
#include <string> | ||
#include <unordered_map> | ||
|
||
#include <glm/glm.hpp> | ||
|
||
#include "glad/glad.h" | ||
|
||
namespace quickviz { | ||
class Shader { | ||
public: | ||
enum class Type { | ||
kUnknown = 0, | ||
kVertex, | ||
kFragment, | ||
}; | ||
|
||
public: | ||
Shader(const std::string& source, Type type); | ||
~Shader(); | ||
|
||
// public methods | ||
void Compile(); | ||
GLuint GetShaderID() const { return shader_id_; } | ||
|
||
private: | ||
std::string LoadSourceFile(const std::string& file_path); | ||
|
||
GLuint shader_id_; | ||
Type type_; | ||
}; | ||
} // namespace quickviz | ||
|
||
#endif // XMOTION_SHADER_HPP |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* @file shader.cpp | ||
* @date 11/2/24 | ||
* @brief | ||
* | ||
* @copyright Copyright (c) 2024 Ruixiang Du (rdu) | ||
*/ | ||
|
||
#include "imview/widget/details/shader.hpp" | ||
|
||
namespace quickviz {} // namespace quickviz |