Panda3d,MSVC下编译第一个窗口应用

本文介绍了如何在Microsoft Visual Studio(MSVC)环境下,使用Panda3d库编译并运行第一个窗口应用程序。步骤包括新建Win32 Console工程,添加cpp文件,配置编译模式,设置包含目录、库目录和链接库,并修改预处理器定义。最终成功编译后,程序在release模式下运行。
摘要由CSDN通过智能技术生成

官网上第一个窗口代码是这样的,


#include "pandaFramework.h"
#include "pandaSystem.h"

int main(int argc, char *argv[]) {
	//open a new window framework
	PandaFramework framework;
	framework.open_framework(argc, argv);
	//set the window title to My Panda3D Window
	framework.set_window_title("My Panda3D Window");
	//open the window
	WindowFramework *window = framework.open_window();

	//here is room for your own code

	//do the main loop, equal to run() in python
	framework.main_loop();
	//close the window framework
	framework.close_framework();
	return (0);
}

这个程序正常跑起来的话,能够创建一个灰色底的窗口,窗口本身没有什么用处,因为没有显示任何东西。但是编译和链接的过程,能让我们知道怎么样加入我们的应用代码。


步骤:

1、用MSVC建立新的工程,选择win32 | console

2、新工程里加入一个cpp文件,取名main.cpp

3、拷贝上面的代码到该cpp中

4、默认的debug模式改成Release(这一步按官网说,是必须的,否则运行会cr

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值