opengl - glFogCoordf was not declared in this scope -
i working through examples of opengl programming guide version 2.1
i know should using opengl version 4, because obsolete, , working way version 4, don't worry that.
the problem have 1 of examples uses 'glfogcoordf' function apparently doesn't exist!
code:
#include <gl/glut.h> #include <cstdlib> #include <iostream> static glfloat f1, f2, f3; static void init() { glfloat fogcolor[4] = { 0.0, 0.25, 0.5, 1.0 }; f1 = 1.0f; f2 = 5.0f; f3 = 10.0f; glenable(gl_fog); glfogi(gl_fog_mode, gl_exp); glfogfv(gl_fog_color, fogcolor); glfogf(gl_fog_density, 0.25); glhint(gl_fog_hint, gl_dont_care); glfogi(gl_fog_coord_src, gl_fog_coord); glclearcolor(0.0, 0.25, 0.25, 1.0); } void display() { glclear(gl_color_buffer_bit | gl_depth_buffer_bit); glcolor3f(1.0f, 0.75f, 0.0f); glbegin(gl_triangles); glfogcoordf(f1); glvertex3f(2.0f, -2.0f, 0.0f); glfogcoordf(f2); glvertex3f(-2.0f, 0.0f, -5.0f); glfogcoordf(f3); glvertex3f(0.0f, 2.0f, -10.0f); glend(); glutswapbuffers(); } all other gl...() functions have worked before, glfogcoord{fd}() , glfogcoord{fd}v() don't seem exist... have never had either of these 2 working, , code completion thing inside codeblocks doesn't recognise completions 'glfog'.
anyone know reason might be?
notes
glfogcoordavailable if gl version 1.4 or greater.
check gl_version. if it's 1.1 you're probably using windows. opengl32.dll exports opengl 1.1 api.
use glew load "new" api entry points.
Comments
Post a Comment