adding developer console connect with 'dev bl bla bla lb' command.

This commit is contained in:
Andreas Ortmann 2016-10-03 22:58:52 +02:00
parent 4e46d65c27
commit ed32f515a3
11 changed files with 211 additions and 32 deletions

View file

@ -7,15 +7,40 @@
#include "glclasses.hpp"
//class VertexAttribute {
// std::string nameInShader;
// Guint attributeIndex;
// Type type;
// modifictaion
// void *dataSource;
//};
namespace endofthejedi {
#if 0
class VertexAttribute {
public:
class Data {
public:
enum class Type {
Integer, Float, Float2, Float3, Float4, Matrix3, Matrix4
};
void setDataInteger(int index, int v)
{
}
Data(Type type, int size) : m_type(type), m_size(size)
{
if (type ==
}
private:
int m_size;
Type m_type;
std::vector<int> m_sourceInteger;
std::vector<float> m_sourceFloat;
};
public:
Data data;
std::string variableName;
int divisor;
GLint index;
};
#endif
class ParticleBatch {
public:
ParticleBatch(size_t id, size_t numParticles, float particleRadius, float halfAge);
@ -23,28 +48,32 @@ namespace endofthejedi {
// deallocate opengl stuff on destroy
~ParticleBatch();
size_t numParticles() const { return m_numParticles; }
// set particle data
void setParticle(size_t index, const glm::vec3 &p, const glm::vec3 &v, float maxDistance);
void setCenter(const glm::vec3 &center);
void setMaxVelocity(float maxVelocity);
// stuff for setup/rendering usage
void setup(Shader *shader);
void bind();
void upload();
void render(Shader *shader);
// advance internal state (mostly age)
void tick(float dt);
float ageNormalized() const { return m_age / (m_maxNumHalfAges*m_halfAge); }
float age() const { return m_age; }
// check if the lifetime is over and whether it can be deleted.
bool done() const;
size_t id() const { return m_id; }
// access attributes
size_t numParticles() const { return m_numParticles; }
float ageNormalized() const { return m_age / (m_maxNumHalfAges*m_halfAge); }
float age() const { return m_age; }
size_t id() const { return m_id; }
const glm::vec3 &explosionCenter() const { return m_center; }
// set attributes
void setCenter(const glm::vec3 &center);
void setMaxVelocity(float maxVelocity);
private:
size_t dataSizeForIndex(size_t index);
void *dataSourceForIndex(size_t index);

View file

@ -39,7 +39,8 @@ namespace endofthejedi {
addModel("../data/mesh/planet_128.stl", &m_planetModel);
addModel("../data/mesh/ship_ufo.stl", &m_shipModel);
m_texture = new ImageTexture("../data/img/test.png");
//m_texture = new ImageTexture("../data/img/test.png");
m_texture = new ImageTexture("../data/img/stars_nebular.png");
glActiveTexture(GL_TEXTURE0);
m_texture->loadPng();