Initial commit

This commit is contained in:
Red Duck 2022-04-07 16:50:51 +03:00
commit 2193fa6696
390 changed files with 138391 additions and 0 deletions

25
classes/colors.cpp Normal file
View file

@ -0,0 +1,25 @@
#include "../headers/colors.h"
int COLORS::hexToDec(char num[]) {
int len = strlen(num);
int base = 1;
int temp = 0;
for (int i=len-1; i>=0; i--) {
if (num[i]>='0' && num[i]<='9') {
temp += (num[i] - 48)*base;
base = base * 16;
}
else if (num[i]>='A' && num[i]<='F') {
temp += (num[i] - 55)*base;
base = base*16;
}
}
return temp;
}
// int COLORS::toRGB(char hexcode[]) {
// std::vector rgb;
// for(int i = 0; i < 3; i++) {
// rgb.push_back(hexToDec(hexcode[i*2] + hexcode[i*2+1]));
// }
// }

0
classes/controls.cpp Normal file
View file

21
classes/renderer.cpp Normal file
View file

@ -0,0 +1,21 @@
#include "../headers/renderer.h"
#include "colors.cpp"
#include "../shaderloader.cpp"
void drawCube() {
// here go something that make cube draw yes
return;
}
void RENDERER::render(GLFWwindow *window)
{
// Here's where we do the rendering itself
glBegin(GL_TRIANGLES);
glColor3f(1.0f, 0.0f, 0.0f);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
glEnd();
// This will write the current frame to the screen
glClear(GL_COLOR_BUFFER_BIT);
return;
}