Do I need to learn C++ to use Open GL?

lampShade
  • Do I need to learn C++ to use Open GL? lampShade

    Do I need to learn C++ to use Open GL?

  • Not necessarily. In fact, OpenGL is native C. There is JOGL, which is a Java wrapper.
    OpenGL ES, which is for the iPhone. I believe this is in Obj-C as well as C/C++. [Not sure, think so]
    I think things like PyGame end up as OpenGL in the end, and they're done in Python.

    But for raw OpenGL for the PC, the only choices I know of are C, C++, or Java.

  • Not at all! Due to its simple C API, OpenGL has bindings available for Java, Python, Ruby, and just about any other language you can think of!

  • OpenGL is a C API. There are bindings for other languages but samples in books and tutorials tend to be written in C.

    Because of this knowing C can help. You definitely don't have to learn C++ to use OpenGL though.

Tags
c++ opengl
Related questions and answers
  • ); glDrawArrays(GL_TRIANGLES, 0, 6); glBindTexture(GL_TEXTURE_2D, 0); } Tried everything I can think of or find in a FBO tutorial or have read about. I don't get any errors and it returns as complete. (Also I can't seem to get it glTexImage2d a image of size width and height. says invalid values, and if I try to use GL_TEXTURE_RECTANGLE it says invalid enum :-/ but that's for a different question...(mats.mvHandle,1,GL_FALSE,glm::value_ptr(mats.modelViewMatrix)); //bind to vertex array object glBindVertexArray(vaoHandle); //render scene glDrawArrays(GL_TRIANGLES, 0, 240*3 ); //do post-processing

  • ].MatIndex].tex.Use(); // AFTER THE TEXTURE IS APPLIED I INSERT THE TOON FUNCTIONS HERE (FIRST PASS) glHint (GL_LINE_SMOOTH_HINT, GL_NICEST); // Use The Good... ( NEW ) // For Crying Out Loud Don't Let OpenGL Use Bi/Trilinear Filtering! ( NEW ) glTexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri (GL_TEXTURE_1D, GL... (TOON SHADE) glHint (GL_LINE_SMOOTH_HINT, GL_NICEST); // Use The Good Calculations ( NEW ) glEnable (GL_LINE_SMOOTH); // Cel-Shading Code // glEnable (GL_TEXTURE_1D

  • = SDL_DisplayFormat(zoomedImage); SDL_FreeSurface(zoomedImage); } return optimizedImage; } ...here is the code I actually use to create the GL texture... GLuint thisIsMyTexture...I am making a game using OpenGL, with SDL_Image employed to load the textures. When drawn on screen, there's no alpha -- in an exact square around the opaque contents of the texture, black is drawn; outside that space, white is drawn. Here is my OpenGL init code... SDL_SetVideoMode(windowWidth, windowHeight, 16, SDL_HWSURFACE|SDL_GL_DOUBLEBUFFER|SDL_OPENGL); glClearColor(0, 0, 0, 0

  • onscreen, in the shape of the terrain rectangle, but there are no regular lines etc. Here's the code I use for rendering: void ShaderProgram::Draw() { using namespace AntiMatter; if( ! m... into a shader program, for use with glDrawArrays. My vertex data already exists in a VertexBufferObject that uses the following data structure to create a vertex buffer: class CustomVertex { public... ) return; glBindBuffer( GL_ARRAY_BUFFER, m_nVboId ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, m_nVboIdIndex ); glEnableClientState( GL_VERTEX_ARRAY ); glEnableClientState( GL_TEXTURE_COORD_ARRAY

  • I need to draw contour around 2d objects in 3d space. I tried drawing lines around object(+points to fill the gap), but due to line width, some part of it(~50%) was covering object. I tried to use... parts of line are behind object, and some are above. This changes when I move camera, but always there is some part, that is covering it. Here is code, that I use for drawing object: glColorMask...? Thanks in advance. EDIT: 1. I don't have normals of objects. 2. Object can be concave. 3. I can't use shaders(see below why).

  • I'm trying to map a brick texture on the edge of a fountain and I'm using gluDisk for that. How can I make the right coordinates for the disk? My code looks like this and I have only found a function that takes the texture along with the camera. I want the cubic texture to be alongside of the fountain, but gluDisk does a linear mapping. How do I get a circular mapping? void Fountain::Draw...(); // push 3 glTranslatef(0,0,height); // spherical texture generation // this piece of code doesn't work as I intended glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glTexGeni(GL_T

  • ); glBindFramebuffer(GL_FRAMEBUFFER, 0); } Here is my drawing box code, which just takes a transformation matrix and calls the appropriate functions. The current values of P is a projection matrix, and an identity matrix for the view matrix (V). void drawBox(const Matrix4& M) { const Matrix4 MVP = M * V * P; if (boundshader) { glUniformMatrix4fv((*boundshader)("MVP"), 1, GL_FALSE, &... wrong in my frame buffer set up code, or elsewhere. But I can't see what. The FBO is set up through the following function: unsigned int fbo_id; unsigned int depth_buffer; int m_FBOWidth, m_FBOHeight

  • I was wondering what do you need to know in C++ before starting to program with DirectX? I have only been programming in C++ (more for 2D games using SDL and learning the basics) for just over a year, I was wondering what kind of concepts and methods should someone be knowledgeable with or at least have seen before, before attempting to learn how to use Direct X?

  • ]); } glEnd(); } // Use the original orientation. glDisable(GL_CULL_FACE); glPopAttrib(); glPopMatrix(); } void MD2::Interpolate(vec3_t* Vertices) { for(int i = 0; i..._Commands; while(int i = *(Commands++)) { if(i < 0) { glBegin(GL_TRIANGLE_FAN); i = -i; } else { glBegin(GL_TRIANGLE_STRIP); } for(; i > 0; --i, Commands += 3) { md2_glcmd_t* Command = (md2_glcmd_t*)Commands