2

I am using MacBook Pro (13-inch, Mid 2010) and I work with OpenGL. I noticed, some of functions miss in library. I found specifications on the internet about my hardware and it says: "support OpenGL 3.3". It was strange so I printed my OpenGL version and IT IS 2.1, NO 3.3!. (Then I found, newest MacBooks (2014) have the same OpenGL version 2.1, WTF)

Then I almost jumped from window. (JK)

I googled something about 2.1 with some extension ARB, but there is no documentation, no usage, nobody uses it. Can anybody explain me please, what is that? How to use it? What is the difference?

I read (If I understand well), instead of new OpenGL 3.X, there is ARB extension which is similar or something. I hope, if they write to the specification it supports version 3.3, ARB should be the same (the same functions at least).

I would be glad, if somebody explains me what is going on.

Question:

I have problem with multisample texture for FBO drawing. It can be created by function glTexImage2DMultisample with parameter GL_TEXTURE_2D_MULTISAMPLE. It is from version 3.2 or grater.

So what should I use, or is it possible to do it with ARB?

I found GL_ARB_multisample in library. What is that? Any usage? All functions I found on the internet are missing. There are some definitions like GL_MULTISAMPLE_ARB in header. I tried to enable it by glEnable (GL_MULTISAMPLE is defined too), it doesn't work.

Please help me. :(

Edit:

If you know different way to solve this, I would be happy.

Original question: OpenGL - FBO and alpha blending

Community
  • 1
  • 1
eSeverus
  • 552
  • 1
  • 6
  • 18
  • 4
    OS X uses Legacy Profile as default for all created OpenGL context and that is 2.1. You need to tell that you want to use Core Profile (3.2+). Look at my [answer](http://stackoverflow.com/a/20932820/1960455) to the question [Shader can't be compiled](http://stackoverflow.com/q/20931528/1960455) – t.niese Jan 31 '15 at 13:38
  • 1
    In addition to [What does ARB mean in the opengl functions?](http://stackoverflow.com/q/2033514/1960455): they are used by creators of the drivers to support functions that will most likely be in the next release of OpenGL. The functions and constants are prefixed by ARB to indicate that the are not part of the actual OpenGL version you are using. Beside that prefix there is generally no difference between the official documentation. – t.niese Jan 31 '15 at 13:48
  • Okay, I can use functions now, but everything seems broken. If I use `glBindTexture`, `glTexImageMultisample` or try to get `GL_MAX_COLOR_TEXTURE_SAMPLES` number, I get with `glGetError` error `GL_INVALID_ENUM` or `GL_INVALID_OPERATION`. I read your answer and you used GLUT library. What if I don't use GLUT? How to use/include it properly? Thanks. – eSeverus Jan 31 '15 at 17:58
  • Got it, sorry for annoying questions. Thanks a lot. – eSeverus Jan 31 '15 at 18:25

1 Answers1

1

You must switch OpenGL context from Legacy to Core profile. Core profile requires some changes in your code. You must migrate your code and shaders, because it's new version of OpenGL and GLSL. Check official video, how to migrate and rewrite functions to validate code for new version. Apple Developer Site - OpenGL (The video on the right side).

The important thing, you must do, is add #import <OpenGL/gl3.h> and all functions will be visible for use.

To get it to work, and debug shaders it's necessary set up NSOpenGLPixelFormat. Add NSOpenGLPFAOpenGLProfile key with NSOpenGLProfileVersion3_2Core value to NSOpenGLPixelFormatAttribute array:

NSOpenGLPixelFormatAttribute attribs[] = {
    // ...
    NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
    // ...
};

This helps you to debug your code.

Thanks a lot for help and I hope, this helps you.

eSeverus
  • 552
  • 1
  • 6
  • 18