-
Anonymous
Программа OpenGL не может нарисовать треугольник?
Сообщение
Anonymous »
Я использую OpenGL с GLEW и GLFW. Я создал два шейдера, и они нормально компилируются:
Код: Выделить всё
#include
#include
#include
#include
static unsigned int CompileShader( unsigned int type, const std::string source){
unsigned int id = glCreateShader(type);
const char* src = source.c_str();
glShaderSource(id, 1, &src, nullptr);
glCompileShader(id);
int result;
glGetShaderiv(id, GL_COMPILE_STATUS, &result);
if (result == GL_FALSE){
int length;
glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length);
char* message = (char*)alloca(length * sizeof(char));
glGetShaderInfoLog(id, length, &length, message);
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79236064/opengl-program-fails-to-draw-triangle[/url]
1732910790
Anonymous
Я использую OpenGL с GLEW и GLFW. Я создал два шейдера, и они нормально компилируются:
[code]#include
#include
#include
#include
static unsigned int CompileShader( unsigned int type, const std::string source){
unsigned int id = glCreateShader(type);
const char* src = source.c_str();
glShaderSource(id, 1, &src, nullptr);
glCompileShader(id);
int result;
glGetShaderiv(id, GL_COMPILE_STATUS, &result);
if (result == GL_FALSE){
int length;
glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length);
char* message = (char*)alloca(length * sizeof(char));
glGetShaderInfoLog(id, length, &length, message);
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79236064/opengl-program-fails-to-draw-triangle[/url]