Код: Выделить всё
#pragma once
#include
#include
#include
#include
#include
#include
using namespace std;
class Shader {
public:
unsigned int prg;
GLenum error = glGetError();
Shader(const char* verti, const char* frag) {
string vertiSrc, fragSrc;
ifstream vertiFile;
ifstream fragFile;
//check to see if we can throw exceptions
vertiFile.exceptions(ifstream::failbit | ifstream::badbit);
fragFile.exceptions(ifstream::failbit | ifstream::badbit);
try {
vertiFile.open(verti);
fragFile.open(frag);
stringstream vertiStream, fragStream;
//have file contents go into streams
vertiStream
Подробнее здесь: [url]https://stackoverflow.com/questions/79777083/why-does-running-a-shader-program-trigger-multiple-opengl-error[/url]
Мобильная версия