OpenGL 3+ için bazı OpenGL eğitimlerini takiben, kapının hemen dışında bazı uyumsuzluklar yaşadım, işte benim aldığım kod, ama kapının hemen dışında Bu devasa hataları bir araya getiriyorum, bunların hiçbiri dahil edilen başlıkları bulamıyor, ama sadece başlıklar temel işlevleri tanımlamıyor.glfwOpenWindowBu kapsamda bildirilmemiş GLFW3 & GLEW
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glfw3.h>
#include <glm/glm.hpp>
int main(){
// Initialise GLFW
if(!glfwInit())
{
fprintf(stderr, "Failed to initialize GLFW\n");
return -1;
}
glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4); // 4x antialiasing
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); //I don't want the
//old OpenGL
// Open a window and create its OpenGL context
if(!glfwOpenWindow(1024, 768, 0,0,0,0, 32,0, GLFW_WINDOW))
{
fprintf(stderr, "Failed to open GLFW window\n");
glfwTerminate();
return -1;
}
// Initialize GLEW
glewExperimental=true; // Needed in core profile
if (glewInit() != GLEW_OK) {
fprintf(stderr, "Failed to initialize GLEW\n");
return -1;
}
glfwSetWindowTitle("Tutorial 01");
// Ensure we can capture the escape key being pressed below
glfwEnable(GLFW_STICKY_KEYS);
do{
// Draw nothing
// Swap buffers
glfwSwapBuffers();
} // Check if the ESC key was pressed or the window was closed
while(glfwGetKey(GLFW_KEY_ESC) != GLFW_PRESS &&
glfwGetWindowParam(GLFW_OPENED));
MinGW çok bu sevmez ve bir OpenGL penceresi var olmaya için gerekli olan her biri "ilan edilmemiş" hataları, bir ton üretti gerçeği olmanın sorunu. Hiç SDL2'den başka bir grafik kütüphanesi ile çalışmadım, bu yüzden bana bu konuda yürüyebilmeniz gerekebilir ... Bu çok takdir edilecek.
SigmaGLPP\main.cpp:23:20: error: 'GLFW_FSAA_SAMPLES' was not declared in this scope
SigmaGLPP\main.cpp:23:40: error: 'glfwOpenWindowHint' was not declared in this scope
SigmaGLPP\main.cpp:24:20: error: 'GLFW_OPENGL_VERSION_MAJOR' was not declared in this
scope
SigmaGLPP\main.cpp:25:20: error: 'GLFW_OPENGL_VERSION_MINOR' was not declared in this
scope
SigmaGLPP\main.cpp:29:48: error: 'GLFW_WINDOW' was not declared in this scope
SigmaGLPP\main.cpp:29:60: error: 'glfwOpenWindow' was not declared in this scope
SigmaGLPP\main.cpp:43:35: error: cannot convert 'const char*' to 'GLFWwindow*' for
argument '1' to 'void glfwSetWindowTitle(GLFWwindow*, const char*)'
SigmaGLPP\main.cpp:46:30: error: 'glfwEnable' was not declared in this scope
SigmaGLPP\main.cpp:52:21: error: too few arguments to function 'void
glfwSwapBuffers(GLFWwindow*)'
SigmaGLPP\main.cpp:55:20: error: 'GLFW_KEY_ESC' was not declared in this scope
SigmaGLPP\main.cpp:56:21: error: 'GLFW_OPENED' was not declared in this scope
SigmaGLPP\main.cpp:56:33: error: 'glfwGetWindowParam' was not declared in this scope
SigmaGLPP\main.cpp:56:36: error: expected '}' at end of input
Temel gölgelendiricileri yüklemeyi başardınız mı? – SpicyWeenie