mesh/texture work
This commit is contained in:
parent
03b8658666
commit
5ff134abe4
19 changed files with 376 additions and 22 deletions
|
|
@ -11,15 +11,25 @@ namespace fishbone {
|
|||
|
||||
#include <fishbone/window.h>
|
||||
#include <fishbone/meshldr.h>
|
||||
#include <fishbone/textureldr.h>
|
||||
|
||||
namespace fishbone {
|
||||
class Texture {
|
||||
void init(fishbone::Renderer* renderer, unsigned char* rgba, int width, int height);
|
||||
|
||||
struct Impl;
|
||||
Impl* impl;
|
||||
|
||||
public:
|
||||
Texture(fishbone::Renderer* renderer, unsigned char* rgba, int width, int height);
|
||||
Texture(fishbone::Renderer* renderer, unsigned char* rgba, int width, int height) {
|
||||
this->init(renderer, rgba, width, height);
|
||||
}
|
||||
Texture(fishbone::Renderer* renderer, fishbone::TextureData* data) {
|
||||
this->init(renderer, data->rgba, data->width, data->height);
|
||||
}
|
||||
~Texture();
|
||||
|
||||
void use();
|
||||
};
|
||||
|
||||
class Mesh {
|
||||
|
|
@ -38,6 +48,10 @@ namespace fishbone {
|
|||
~Mesh();
|
||||
|
||||
void draw();
|
||||
void draw(struct fishbone::Vector3 pos);
|
||||
void draw(struct fishbone::Vector3 pos, struct fishbone::Vector3 rot);
|
||||
|
||||
fishbone::Texture* texture;
|
||||
};
|
||||
|
||||
class Renderer {
|
||||
|
|
@ -47,7 +61,11 @@ namespace fishbone {
|
|||
public:
|
||||
Renderer(fishbone::Window* window);
|
||||
~Renderer();
|
||||
|
||||
void prepare();
|
||||
};
|
||||
|
||||
static float maxDistance = 64;
|
||||
}; // namespace fishbone
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue