Skip to content

Commit

Permalink
added stars
Browse files Browse the repository at this point in the history
  • Loading branch information
fauwara committed Jul 19, 2022
1 parent 376542a commit f8de7da
Show file tree
Hide file tree
Showing 14 changed files with 203 additions and 38 deletions.
5 changes: 4 additions & 1 deletion Audio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class Audio {

const sf::Int16* samples;
sf::Uint64 sampleSize;

sf::Time duration;

// load raw audio data into buffer
void loadBuffer( std::string audioFilePath) {
Expand All @@ -27,7 +29,8 @@ class Audio {

sampleRate = buffer.getSampleRate();
sampleCount = buffer.getSampleCount();

duration = buffer.getDuration();

}

};
Binary file added Audio/eden-xo.wav
Binary file not shown.
18 changes: 12 additions & 6 deletions Graphic/Bar.hpp
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
#pragma once

#include <GL/glut.h>


class Bar {

public:
const int numBar = 20; // number of bars
const int count = 30; // number of bars
float scaleBar; // value to scale the bars
// float barScale[];

GLfloat barVertices[8] = {
GLfloat vertices[8] = {
-0.90, 0.05,
-0.95, 0.05,
-0.95, -0.05,
-0.90, -0.05,
};

// color format: CMY
GLfloat barColors[12] = {
GLfloat colors[12] = {
// 0.6275, 0.7059, 0.2863, // purple
// 0.6275, 0.7059, 0.2863,
// 0.1451, 0.0000, 0.5098, // green
// 0.1451, 0.0000, 0.5098,
0.2314, 0.2824, 0.2039, // light purple
0.2314, 0.2824, 0.2039,
0.4078, 0.0824, 0.1765, // mint bllue
0.4078, 0.0824, 0.1765,
0.2314, 0.2824, 0.2039,
0.2314, 0.2824, 0.2039,
// 1.0, 1.0, 1.0, //white
// 1.0, 1.0, 1.0,
// 0.4078, 0.0824, 0.1765, // mint bllue
// 0.4078, 0.0824, 0.1765,
};

// bar indices
GLubyte barIndices[4] = {
GLubyte indices[4] = {
0, 1,
2, 3,
};
Expand Down
40 changes: 40 additions & 0 deletions Graphic/Stars.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#pragma once

#include <GL/glut.h>


class Star {

public:

float size = 3;
float displace = 0;
// float displaceY = 0;

GLfloat vertices[2] = {
0.0, 0.0,
};

// color format: CMY
GLfloat colorsOff[4] = {
0.0, 0.0, 0.0, 1.0
};

GLfloat colorsOn[4] = {
1.0, 0.0, 0.0, 1.0
};

// bar indices
GLubyte indices[2] = {
0, 1,
};

// initialize barScale
// void initBarScale() {
// for ( int i = 0; i < numBar; i++) {
// barScale[i] = 0;
// }
// }


};
51 changes: 51 additions & 0 deletions Graphic/sky.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#pragma once

#include <GL/glut.h>


class Sky {

public:
// const int count = 30; // number of bars
// float scaleBar; // value to scale the bars
// float barScale[];

GLfloat vertices[8] = {
-1, 1,
-1, 1,
-1, -1,
-1, -1,
};

// color format: CMY
GLfloat colors[12] = {
// 0.6275, 0.7059, 0.2863, // purple
// 0.6275, 0.7059, 0.2863,
// 0.1451, 0.0000, 0.5098, // green
// 0.1451, 0.0000, 0.5098,
// 0.2314, 0.2824, 0.2039, // light purple
// 0.2314, 0.2824, 0.2039,
1.0, 0.0, 0.0, //white
1.0, 0.0, 0.0, //white
1.0, 0.0, 0.0, //white
1.0, 0.0, 0.0, //white
// 1.0, 1.0, 1.0,
// 0.4078, 0.0824, 0.1765, // mint bllue
// 0.4078, 0.0824, 0.1765,
};

// bar indices
GLubyte indices[4] = {
0, 1,
2, 3,
};

// initialize barScale
// void initBarScale() {
// for ( int i = 0; i < numBar; i++) {
// barScale[i] = 0;
// }
// }


};
Binary file added Textures/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Textures/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Textures/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Textures/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Textures/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Textures/skybox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Textures/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified a.out
Binary file not shown.
Loading

0 comments on commit f8de7da

Please sign in to comment.