OpenGL headers for OS X & Linux

前端 未结 4 570
谎友^
谎友^ 2021-02-05 22:58

I\'d like to have both the includes for OS X as well as linux in my opengl program (C++) how can I set my program to use one if the other is not available? Here\'s what i\'m cur

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-05 23:25

    Alternatively, put the platform specific headers into their own files:

    linux\platform.h

    #include 
    #include 
    

    osx\platform.h

    #include  //OS x libs
    #include 
    #include 
    

    win32\platform.h

    #include 
    #include 
    #include 
    

    and include in code:

    #include "platform.h"
    

    and then let your build system specify the correct search path based on the target platform.

提交回复
热议问题