简体   繁体   English

我可以在代码中明确禁用已弃用的OpenGL函数吗?

[英]Can I explicitly disable deprecated OpenGL functions in my code?

I recently started writing code that uses newer implementations of OpenGL. 我最近开始编写使用OpenGL较新实现的代码。 I did however notice, than in newer OpenGL implementations a lof of old functions are considered as deprecated. 我注意到,与在较新的OpenGL实现中相比,旧的函数被认为是不推荐的。 Is there any way to disable them if I only want to use proper functions? 如果我只想使用正确的功能,有没有办法禁用它们?

Use ARB_create_context_profile and request a forward-compatible context. 使用ARB_create_context_profile并请求向前兼容的上下文。

Forward-compatible contexts are defined only for OpenGL versions 3.0 and later. 前向兼容的上下文仅针对OpenGL 3.0及更高版本定义。 They must not support functionality marked as deprecated by that version of the API, while a non-forward-compatible context must support all functionality in that version, deprecated or not. 它们不得支持该API版本标记为已弃用的功能,而非向前兼容的上下文必须支持该版本中的所有功能,不推荐使用或不支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 OpenGL'弃用'功能可能不受支持吗? - Can the OpenGL 'deprecated' functions possibly be unsupported? 如何在GCC中弃用已弃用的函数中删除已弃用的警告? - How can I get rid of deprecated warnings in deprecated functions in GCC? 我可以在OpenGL中禁用自动错误处理吗? - Can I disable automatic error handling in OpenGL? 如何替换以下(已弃用)OpenGL函数? - How to replace following (deprecated) OpenGL functions? Mingw禁用标记为不赞成使用的类/功能/类型吗? - Mingw Disable Classes/Functions/Types Marked Deprecated? 我可以使用矢量(OpenGL)构建网格吗 - Can I build my meshes with a vector (OpenGL) 我如何在OpenGL中旋转我的对象 - how can i rotate my object in opengl 我正确地构建这些引用和指针函数吗? 如果是这样,我如何明确地调用我的析构函数? - Am I building these reference and pointer functions correctly? And if so, how do I explicitly call my destructor? 如何避免使用依赖于参数的查找来明确地专门化模板化函数 - How Can I Avoid Explicitly Specializing Templatized Functions With Argument Dependent Lookup 如何禁止调试控制台在代码中显示文件地址? - How can I disable the debug console from showing the file address in my code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM