1
0

Finished for Abgabe

This commit is contained in:
Niklas Birk 2020-04-01 22:17:35 +02:00
parent 0ac020d531
commit 33329c10d0
14 changed files with 20 additions and 33 deletions

View File

@ -48,12 +48,12 @@ int main()
emitter *e;
particle *p;
vector3f *pos;
for (int j = 0; j < ps->eamount; j++)
for (int y = 0; y < ps->eamount; y++)
{
e = (ps->emitters)[j];
for (int i = 0; i < e->pamount; i++)
e = (ps->emitters)[y];
for (int x = 0; x < e->pamount; x++)
{
p = (e->particles)[i];
p = (e->particles)[x];
pos = p->position;
glColor3f(p->color->x, p->color->y, p->color->z);

View File

@ -1,11 +1,7 @@
#include "glad/glad.h"
#include <GLFW/glfw3.h>
#ifndef INFORMATIKPROJEKT_INITOPENGL_H
#define INFORMATIKPROJEKT_INITOPENGL_H
void initGlad();
void initGLFW();
@ -21,5 +17,3 @@ void framebufferSizeCallback(GLFWwindow *window, int width, int height);
GLuint compileShader(const GLchar *shaderSource, GLenum shaderType);
GLuint linkShaders(GLuint *shaders, GLsizei count);
void deleteShaders(GLuint *shaders, GLsizei count);
#endif //INFORMATIKPROJEKT_INITOPENGL_H

View File

@ -14,7 +14,7 @@
#define ENGINE_NAME "rwu_particles"
#define ENGINE_VERSION VK_MAKE_VERSION(0, 0, 0)
#define PARTICLE_AMOUNT 10000000
#define PARTICLE_AMOUNT 1000000
#define PARTICLE_SIZE (3 * sizeof(vector3f) + sizeof(float))
#define WORKGROUP_SIZE_Y 1
#define WORKGROUP_SIZE_Z 1
@ -144,5 +144,3 @@ void createGraphicsCommandBuffers(Graphics *graphics);
// Else
void mapBufferMemory(Compute *compute, VkDeviceMemory memory, void *inputData, uint32_t dataSize);
void createSemaphore(VkDevice device, VkSemaphore *semaphore);

View File

@ -102,6 +102,7 @@ int main()
glfwPollEvents();
}
//END
deleteShaders(renderShaders, 2);
glDeleteProgram(renderShaderProgram);

View File

@ -42,7 +42,7 @@ particle_system *initParticleSystem(int eamount)
/*
* Updates particles
*/
int updateParticles(float dt, particle_system *ps, CalculatePositionFunction calculatePosition, CalculateColorFunction calculateColor)
void updateParticles(float dt, particle_system *ps, CalculatePositionFunction calculatePosition, CalculateColorFunction calculateColor)
{
emitter *e;
particle *p;

View File

@ -69,7 +69,7 @@ particle_system *initParticleSystem(int eamount);
/*
* Updates particle
*/
int updateParticles(float dt, particle_system *particleSystem, CalculatePositionFunction calculatePosition, CalculateColorFunction calculateColor);
void updateParticles(float dt, particle_system *particleSystem, CalculatePositionFunction calculatePosition, CalculateColorFunction calculateColor);
/*
* Resets a particle to seed at emitter's position

View File

@ -7,6 +7,3 @@ void main(void)
{
colOut = vec4(colV, 1);
}

View File

@ -10,5 +10,3 @@ void main(void)
colV = colIn;
gl_Position = vec4(pos, 1);
}

View File

@ -143,4 +143,3 @@ int main()
return SUCCESS;
}