texture
This commit is contained in:
parent
f2604d01cd
commit
3072248158
19 changed files with 193 additions and 36 deletions
|
|
@ -1,19 +1,29 @@
|
|||
#ifndef __FISHBONE_CLIENT_H__
|
||||
#define __FISHBONE_CLIENT_H__
|
||||
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
namespace fishbone {
|
||||
class Client;
|
||||
};
|
||||
|
||||
#include <fishbone/machdep.h>
|
||||
#include <fishbone/sound.h>
|
||||
#include <fishbone/window.h>
|
||||
#include <fishbone/mixer.h>
|
||||
#include <fishbone/draw.h>
|
||||
|
||||
namespace fishbone {
|
||||
class Client {
|
||||
public:
|
||||
fishbone::SoundDriver sound;
|
||||
fishbone::Window window;
|
||||
Client(std::unordered_map<std::string, std::vector<std::string>> param);
|
||||
~Client();
|
||||
|
||||
bool step();
|
||||
|
||||
fishbone::Window* window;
|
||||
fishbone::SoundDriver* sounddrv;
|
||||
fishbone::Mixer* mixer;
|
||||
fishbone::Renderer* renderer;
|
||||
};
|
||||
}; // namespace fishbone
|
||||
|
||||
|
|
|
|||
43
engine/include/fishbone/draw.h
Normal file
43
engine/include/fishbone/draw.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef __FISHBOWL_DRAW_H__
|
||||
#define __FISHBOWL_DRAW_H__
|
||||
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
namespace fishbone {
|
||||
class Texture;
|
||||
class Mesh;
|
||||
class Renderer;
|
||||
};
|
||||
|
||||
/* no includes */
|
||||
|
||||
namespace fishbone {
|
||||
class Texture {
|
||||
struct Impl;
|
||||
Impl* impl;
|
||||
|
||||
public:
|
||||
Texture(fishbone::Renderer* renderer, unsigned char* rgba, int width, int height);
|
||||
~Texture();
|
||||
};
|
||||
|
||||
class Mesh {
|
||||
struct Impl;
|
||||
Impl* impl;
|
||||
|
||||
public:
|
||||
Mesh(fishbone::Renderer* renderer, std::vector<struct fishbone::Vector3> vertices, std::vector<struct fishbone::Vector2> texcoords, std::vector<struct fishbone::Vector3> normals);
|
||||
~Mesh();
|
||||
};
|
||||
|
||||
class Renderer {
|
||||
struct Impl;
|
||||
Impl* impl;
|
||||
|
||||
public:
|
||||
Renderer();
|
||||
~Renderer();
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
#ifndef __FISHBONE_FILE_H__
|
||||
#define __FISHBONE_FILE_H__
|
||||
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
namespace fishbone {
|
||||
class File;
|
||||
};
|
||||
|
||||
#include <fishbone/machdep.h>
|
||||
/* no includes */
|
||||
|
||||
namespace fishbone {
|
||||
class File {
|
||||
|
|
|
|||
|
|
@ -8,5 +8,7 @@
|
|||
#include <fishbone/file.h>
|
||||
#include <fishbone/window.h>
|
||||
#include <fishbone/resource.h>
|
||||
#include <fishbone/draw.h>
|
||||
#include <fishbone/time.h>
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
#include <vector>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <chrono>
|
||||
#include <unordered_map>
|
||||
#include <functional>
|
||||
|
||||
#include <cstdio>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
#ifndef __FISHBONE_MIXER_H__
|
||||
#define __FISHBONE_MIXER_H__
|
||||
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
namespace fishbone {
|
||||
class Mixer;
|
||||
};
|
||||
|
||||
#include <fishbone/machdep.h>
|
||||
#include <fishbone/sound.h>
|
||||
#include <fishbone/thread.h>
|
||||
|
||||
|
|
|
|||
7
engine/include/fishbone/pre.h
Normal file
7
engine/include/fishbone/pre.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#ifndef __FISHBONE_PRE_H__
|
||||
#define __FISHBONE_PRE_H__
|
||||
|
||||
#include <fishbone/machdep.h>
|
||||
#include <fishbone/types.h>
|
||||
|
||||
#endif
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
#ifndef __FISHBONE_THREAD_H__
|
||||
#define __FISHBONE_THREAD_H__
|
||||
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
namespace fishbone {
|
||||
class Resource;
|
||||
}; // namespace fishbone
|
||||
|
||||
#include <fishbone/machdep.h>
|
||||
#include <fishbone/file.h>
|
||||
|
||||
namespace fishbone {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef __FISHBONE_SOUND_H__
|
||||
#define __FISHBONE_SOUND_H__
|
||||
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
#define FB_SOUND_DECL(prefix) \
|
||||
class prefix##SoundLoader; \
|
||||
class prefix##Sound
|
||||
|
|
@ -37,7 +39,6 @@ namespace fishbone {
|
|||
#undef LOADER
|
||||
}; // namespace fishbone
|
||||
|
||||
#include <fishbone/machdep.h>
|
||||
#include <fishbone/mixer.h>
|
||||
|
||||
namespace fishbone {
|
||||
|
|
@ -54,12 +55,12 @@ namespace fishbone {
|
|||
|
||||
class SoundLoader {
|
||||
public:
|
||||
SoundLoader();
|
||||
~SoundLoader();
|
||||
SoundLoader(){};
|
||||
~SoundLoader(){};
|
||||
|
||||
virtual Sound* open(Mixer* mixer, void* buffer, size_t size);
|
||||
virtual int read(Sound* sound, short* buffer, size_t frames);
|
||||
virtual void seek(Sound* sound, size_t pos);
|
||||
virtual Sound* open(Mixer* mixer, void* buffer, size_t size){return nullptr;};
|
||||
virtual int read(Sound* sound, short* buffer, size_t frames){return 0;};
|
||||
virtual void seek(Sound* sound, size_t pos){};
|
||||
};
|
||||
|
||||
class Sound {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
#ifndef __FISHBONE_THREAD_H__
|
||||
#define __FISHBONE_THREAD_H__
|
||||
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
namespace fishbone {
|
||||
class Thread;
|
||||
class Mutex;
|
||||
}; // namespace fishbone
|
||||
|
||||
#include <fishbone/machdep.h>
|
||||
/* no includes */
|
||||
|
||||
namespace fishbone {
|
||||
class Thread {
|
||||
|
|
|
|||
18
engine/include/fishbone/time.h
Normal file
18
engine/include/fishbone/time.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef __FISHBONE_TIME_H__
|
||||
#define __FISHBONE_TIME_H__
|
||||
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
namespace fishbone {
|
||||
using AccurateClock = std::chrono::time_point<std::chrono::high_resolution_clock, std::chrono::high_resolution_clock::duration>;
|
||||
|
||||
fishbone::AccurateClock accurateTime();
|
||||
};
|
||||
|
||||
/* no includes */
|
||||
|
||||
namespace fishbone {
|
||||
fishbone::AccurateClock accurateTime();
|
||||
};
|
||||
|
||||
#endif
|
||||
19
engine/include/fishbone/types.h
Normal file
19
engine/include/fishbone/types.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __FISHBOWL_TYPES_H__
|
||||
#define __FISHBOWL_TYPES_H__
|
||||
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
namespace fishbone {
|
||||
struct Vector2 {
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
struct Vector3 {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -5,7 +5,7 @@ namespace fishbone {
|
|||
class Window;
|
||||
}; // namespace fishbone
|
||||
|
||||
#include <fishbone/machdep.h>
|
||||
#include <fishbone/pre.h>
|
||||
|
||||
namespace fishbone {
|
||||
class Window {
|
||||
|
|
@ -15,6 +15,8 @@ namespace fishbone {
|
|||
public:
|
||||
Window(std::string title, int width, int height);
|
||||
~Window();
|
||||
|
||||
void poll();
|
||||
};
|
||||
}; // namespace fishbone
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue