![](/img/trans.png)
[英]Where exactly do I add my BMP files in my OpenGL C++ project? Using Xcode for the Mac
[英]How do I create a window in mac using c++ and opengl?
我是Mac开发的新手。 我目前已经开始使用Windows(使用Direct3D)启动3D程序,并且我希望使用opengl扩展到Mac。 我目前有关于如何初始化窗口并使用opengl和windows绘制窗口的代码。 我正在寻找用Mac界面替换此应用程序的Windows部分的最直观的方法。
bool SystemClass::InitializeWindows(OpenGLClass* OpenGL, int& screenWidth, int&screenHeight){
WNDCLASSEX wc;
DEVMODE dmScreenSettings;
int posX, posY;
ApplicationHandle = this;
m_hinstance = GetModuleHandle(NULL);
m_applicationName = L"Engine";
wc.style = CS_HREDRAW;
wc.lpfnWndProc = WndProc;
wc.hInstance = m_hinstance;
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wc.hIconSm = wc.hIcon;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.lpszMenuName = NULL;
wc.lpszClassName = m_applicationName;
wc.cbSize = sizeof(WNDCLASSEX);
//etc
//set full screen mode
//set window to front
//hide mouse
当我对此进行研究时,我看到很多人使用Objective-C或Coco来获得想要的结果吗? 如果可以的话,我仍然可以在coco库中使用c ++或Objective-c ++吗?
最后,最简单的等效于Mac中的messagebox()的是什么? 我使用了NSGetCriticalAlertPanel()但我似乎无法使其正常工作(主要是因为我找不到必须包含的对应库)。
PS:我使用的是xcode编译器,如果有更好的编译器,或者您更喜欢的编译器,请提出建议(我不是xcode的忠实拥护者)。
您可以从此SDL开始-最新的openGL教程 。 您还需要安装XCode可能拥有的东西。 教程中有详细的说明,说明如何将inlcude SDL安装到您的项目中。 一切初始化并准备使用后,您可以在此处找到许多通用的sdl教程 ,您可以将其集中在openGL上的该sdltutorial中 。
也许此SDL FAQ也可能会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.