资源简介
vc OpenGL制作动态三维的雷达扫描效果,一个在VC 下应用OpenGL技术绘制三维动画的好范例,虽然这个例子挺简单,但可以为你以后使用VC 6.0编写大型的3D图像处理软件 、3D游戏开发打下基础吧。
代码片段和文件信息
// Mainframe.cpp : implementation of the CMainframe class
// Download by http://www.srcfans.com
#include “stdafx.h“
#include “spp.h“
#include
#include “Mainframe.h“
#define PI 3.1415926
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
float k=0;
float r1=6.0r2=4.0r3=2.0;
/////////////////////////////////////////////////////////////////////////////
// CMainframe
IMPLEMENT_DYNAMIC(CMainframe CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
ON_WM_PAINT()
ON_WM_SIZE()
ON_WM_SETFOCUS()
ON_WM_QUERYNEWPALETTE()
ON_WM_PALETTECHANGED()
ON_WM_ACTIVATEAPP()
ON_WM_KEYDOWN()
ON_WM_TIMER()
ON_WM_CREATE()
ON_WM_LBUTTONDOWN()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMainframe construction/destruction
CMainframe::CMainframe()
{
VB_WIDTH = 1024;
VB_HEIGHT = 768;
VB_DEPTH = 32;
m_bFullScreen = FALSE;
m_hDC = NULL;
m_hRC = NULL;
m_cxClient = 0;
m_cyClient = 0;
m_hPal = NULL;
m_bAppIsActive = FALSE;
// Ask The User Which Screen Mode They Prefer
if (MessageBox(“Would You Like To Run In Fullscreen Mode?“ “Start FullScreen?“MB_YESNO|MB_ICONQUESTION)==IDYES)
{
m_bFullScreen=TRUE; // Windowed Mode
}
// TODO: add member initialization code here
}
CMainframe::~CMainframe()
{
KillGLWindow(); // Shutdown
}
/////////////////////////////////////////////////////////////////////////////
// CMainframe PreCreateWindow
BOOL CMainframe::PreCreateWindow(CREATESTRUCT& cs)
{
if (!CframeWnd::PreCreateWindow(cs))
return FALSE;
EnumDisplaySettings(NULL ENUM_CURRENT_SETTINGS &m_DMsaved); // save the current display state
if (m_bFullScreen) // Attempt Fullscreen Mode?
{
DEVMODE dmScreenSettings; // Device Mode
memset(&dmScreenSettings0sizeof(dmScreenSettings)); // Makes Sure Memory‘s Cleared
dmScreenSettings.dmSize=sizeof(dmScreenSettings); // Size Of The Devmode Structure
dmScreenSettings.dmPelsWidth = VB_WIDTH; // Selected Screen Width
dmScreenSettings.dmPelsHeight = VB_HEIGHT; // Selected Screen Height
dmScreenSettings.dmBitsPerPel = VB_DEPTH; // Selected Bits Per Pixel
dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
if (ChangeDisplaySettings(&dmScreenSettingsCDS_FULLSCREEN)!=DISP_CHANGE_SUCCESSFUL)
{
// If The Mode Fails Offer Two Options. Quit Or Use Windowed Mode.
if (MessageBox(“The Requested Fullscreen Mode Is Not Supported By\nYour Video Card. Use Windowed Mode Instead?““NeHe GL“MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
{
m_bFullScreen=FALSE; // Windowed Mode Selected.
}
else
{
// Pop Up A Messag
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 18450 2017-02-20 14:04 srcfans.com\雷达\Mainfr
文件 2312 2010-05-16 09:16 srcfans.com\雷达\Mainfr
文件 3849 2010-05-16 09:16 srcfans.com\雷达\ReadMe.txt
文件 1078 2010-05-16 09:16 srcfans.com\雷达\res\spp.ico
文件 395 2010-05-16 09:16 srcfans.com\雷达\res\spp.rc2
文件 437 2010-05-16 09:16 srcfans.com\雷达\Resource.h
文件 19228 2010-08-02 10:33 srcfans.com\雷达\spp.aps
文件 583 2010-05-25 22:12 srcfans.com\雷达\spp.clw
文件 3993 2017-02-20 14:04 srcfans.com\雷达\spp.cpp
文件 4111 2010-05-16 09:16 srcfans.com\雷达\spp.dsp
文件 514 2010-05-16 09:16 srcfans.com\雷达\spp.dsw
文件 1852 2010-05-16 09:16 srcfans.com\雷达\spp.h
文件 3750 2010-05-16 09:16 srcfans.com\雷达\spp.rc
文件 18677 2010-05-16 09:16 srcfans.com\雷达\spp雷达.txt
文件 209 2010-05-16 09:16 srcfans.com\雷达\StdAfx.cpp
文件 1416 2010-05-16 09:16 srcfans.com\雷达\StdAfx.h
目录 0 2017-02-20 14:03 srcfans.com\雷达\res
目录 0 2017-02-20 14:03 srcfans.com\雷达
目录 0 2017-02-20 14:04 srcfans.com
----------- --------- ---------- ----- ----
80854 19
相关资源
- VC 截获QQ聊天内容和登录密码.rar
- VC Agent动画小人仿OFFICE助手动画.ra
- Delphi鼠标区域截图、抓图程序.rar
- VC 窗体美化源码_换肤改变窗口风格
- IDEA实现 springmvc的简单注册登录功能的
- SpringMVC+MyBatis企业应用实战+源码
- VC 6.0 补丁 FileTool.dll
- VC 实现的示波器控件 非常强大
- UVC图像获取及Extension unit数据获取
- 输入法注入源代码VC
- VCE 汉化补丁.txt
- VC Comment注释插件
- VC轻松实现非客户区按钮及源码
- STM32F103VCT6+W5500 TCP 服务端通信成功开
- OpenGL实现下雪的效果
-
VCPA-ba
sed hybrid strategy.zip - 车牌识别VC源代码
- VC 类似迅雷的悬浮窗
- SoCKit_RevC.pdf
- 机械革命ALC269VC带低音炮机型黑苹果仿
- 台达PLC通信程序VC
- VC-easyx绘图游戏简易教程
- 国密sm2算法c实现
- 传智播客 最新版淘淘商城视频教程及
- .NET MVC 中使用 kindeditor 中图片上传和
- vmware vsphere7.0全套
- VMware vsphere 6.7.0
- SSM完整框架
- 2015_MLDN_mybatis_hibernate_springmvc_等视频
- maven+springMVC集成的neo4j
评论
共有 条评论