43 lines
1012 B
C++
43 lines
1012 B
C++
/*
|
|
==============================================================================
|
|
|
|
OpenGLUtils.h
|
|
Created: 17 Jan 2026 11:41:12am
|
|
Author: esca
|
|
|
|
==============================================================================
|
|
*/
|
|
|
|
#pragma once
|
|
#include <vector>
|
|
//random shit for convenience
|
|
|
|
#define VERTEXSHADER R"(#version 330 core
|
|
in vec2 position;
|
|
in vec4 colour;
|
|
out vec4 fragcolour;
|
|
void main(){
|
|
gl_Position = vec4(position, 1, 1);
|
|
fragcolour = colour;
|
|
}
|
|
)"
|
|
|
|
#define FRAGSHADER R"(#version 330 core
|
|
in vec4 fragcolour;
|
|
void main(){
|
|
gl_FragColour = fragcolour;
|
|
}
|
|
)";
|
|
|
|
struct Vertex{
|
|
float position[2];
|
|
float colour[4];
|
|
};
|
|
void svCol(Vertex &v, float newColour[4]);
|
|
|
|
void setColour(std::vector<Vertex> &verticeList, float newColour[4]);
|
|
|
|
void vTransform(std::vector<Vertex> &verticeList, int transform[2]);
|
|
|
|
std::vector<Vertex> generateSineWave(int numVertices, float angle, float startingColour[4]);
|