Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

277
Visualizações
Can the OpenGL 'deprecated' functions possibly be unsupported?

I am testing with glDrawPixels to port my simple pixel-drawn 2D game from Windows API to OpenGL with GLFW. It runs nicely with FPS over 100, additionally cross-platform.

Just one thing that is slightly annoying me is that I'm using a deprecated feature. I don't see any problems now, but will this possibly be a problem in the future? Can glDrawPixels become suddenly removed? All I need is a cross-platform alternative to winapi's CreateWindow and BitBlt.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I'd like to extend on the article about deprecation in the OpenGL wiki which was given in the comments already.

The current situation is that we can discern 3 "flavours" of OpenGL contexts on desktop platforms:

  1. "Legacy" GL. This means the GL from the old days, before there was any deprecation scheme, and before there were specifically versioned contexts or profiles.
  2. "Modern" GL in the core profile.
  3. "Modern" GL in the compatibility profile.

The first case, "legacy" GL, is limited to GL 2.1 and earlier in a cross-platform manner. All major desktop OS (Windows, Linux, OSX) have support for this on all major GPU brands (Intel, NVidia, AMD). And this is unlikely to go away for a long time, since all of the "old" software that is not even aware of the existence of modern GL relies on it.

What I describe as "modern" GL means GL 3.2 and later. And there, profiles have been invented. The crux is that only the core profile is required to be supported, the compatibility profile is optional. In core profiles, the deprecated functions are actually removed, so your code will not work in a core profile. In compatibility profiles, the deprecated functions are still available.

So, the only way to mix old legacy features (like fixed-function pipeline, immediate mode, or your glDrawPixels call) with modern GL features, is a compatibility profile. However, in practice, compatibility support is not generally available. MacOSX generally does not support compatibility profiles, and neither do the open source Linux drivers based on Mesa. So you can't really do cross-platform development with a compatibility profile.

Note that I somehow skipped GL 3.0 and 3.1. They are something in between and I recommend never trying to use them. OSX does not support them at all. And actually, any real world GPU which supports GL 3.0 also supports at least GL 3.2 anyway.

I see two options for you:

  1. If the feature set in GL 2.1 is enough for your use case, you can simply stick to legacy GL. Support for it won't go away for a long time.
  2. Switch to modern GL without use of deprecated functions. glDrawPixels has never been efficient. You are probably far better using a textured quad (or maybe even glBlitFramebuffer) for blitting images to the screen.
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda