VS 2012环境下使用MFC进行OpenGL编程

OpenGL-vs2012-glfw-glew 测试环境搭建 关于visual studio工程中从零搭建OpenGL环境的详细介绍. 如果步骤你都懂得话是来查glfw和glew的库文件链接错误的话,请拉至最后会有对此的解析 error LNK2019: unresolved external symbol __imp__glewInit referenced in function _main 阅读详情

VS 2012下使用MFC+OpenGL基本步骤

引子:以前一直惧怕MFC感觉它是一个非常复杂的东西,更不用说去用它来和OpenGL结合了,以前是一直羡慕别人用MFC创建一个窗口进行OpenGL绘图,当初有萌生自己创建一个MFC使用OpenGL的想法,但是由于各种原因一直没成功,最近我又研究了一下,有了一下这些拙见。之前研究一些东西时候,当初明白了,后来再去用就又要重新学习,一直觉得自己差一个做笔记的习惯,或者在电脑上建立一个文档,但是过一段时间就不知道丢哪里去了,所以我要养成写blog的习惯,把自己的拙见都放到这里,不管简单复杂吧,只为能给自己能有一些收获,当然如果机缘巧合有人来到这里看到我的blog并且获得了帮助,那应该是件非常快乐的事^_^

废话说多了,下面进入我第一篇blog的正题。

 

一、环境:

IDE:VS 2012

工具:OpenGL

二、详细步骤:

1.      创建MFC项目

a.      FILE||New||Project (这里||表示菜单的下一级),如下图:


b.      点击OK后,进入向导界面,其他都默认,只是把Application Type中的Project style修改为MFC standard。如下图,其他默认,OK确认创建。


c.      创建完成界面如下:

2.      导入OpenGL头文件和Lib文件

a.      在stdafx.h中添加语句 #include <GL/GLAUX.H>,如下图:

//OpenGL
#include <GL/GLAUX.H>


<
搭建C++与C#的OpenGL环境 由于某次研究项目需要在C# WPF用Open GL建模,然后就上网搜索相关的环境搭建,发现网上的各种乱转载,搞的乱七八糟的,考虑到我还经常利用C++进行编程,这次特意做一个整理,同时希望也能为广大迷茫的程序猿们尽点微薄之力. 阅读详情

相关推荐

MFC中的OpenGL入门程序

在属性窗口中,选择“配置属性” -> “链接器” -> “输入”。在项目类型中,选择Visual C++ -> MFC,然后选择MFC应用程序。在本篇文章中,我们将介绍如何在MFC应用程序中使用OpenGL进行绘图。在MFC应用程序中,我们需要创建一个绘图窗口来进行OpenGL绘图。为了在OpenGL绘图窗口中进行绘制,我们需要在窗口创建完成后进行初始化。在完成上述步骤后,我们可以运行程序并查看OpenGL绘图窗口的效果。在MFC应用程序中,我们需要处理窗口消息来响应用户的操作。函数激活该绘图窗口。

EctProcessgroup的博客 1260

基于MFC的OpenGL绘图

我们首先配置了OpenGL环境,然后在主窗口类中添加了OpenGL的初始化和绘图函数。通过编写绘图函数中的OpenGL绘图代码,我们可以实现在应用程序窗口中绘制图形。在本文中,我们将探讨如何在基于MFC(Microsoft Foundation Class)的应用程序中使用OpenGL进行绘图。至此,我们已经完成了使用OpenGL在基于MFC的应用程序中进行绘图的设置和代码编写。现在,我们可以在主窗口类的绘图函数中编写OpenGL绘图代码。最后,在主窗口类的消息映射中,添加对绘图消息的处理。

EctProcessgroup的博客 1241

现代OpenGL与MFC结合的入门指南

MFC是Microsoft Foundation Classes的缩写,是一组封装了Windows API的C++类库,用于开发Windows应用程序。通过结合MFC和OpenGL,我们可以在MFC应用程序中添加图形渲染的功能。在本篇文章中,我们将介绍如何将现代OpenGL与MFC(Microsoft Foundation Classes)相结合,以实现基于Windows平台的图形应用程序开发。您可以使用OpenGL提供的各种函数和特性来创建更复杂的图形效果,如纹理映射、光照和变换等。

YkDjango的博客 1034

VC++ MFC对话框中用OpenGL跑起来的纯CPU粒子烟花效果(含高精度计时与BMP贴图)

直接在MFC对话框里跑OpenGL渲染的烟花爆炸动画,所有粒子运动、颜色变化、生命周期都在CPU端算好,不依赖GPU着色器,Win32桌面环境开箱即用。核心是Firework类,改构造函数里的Z值就能调烟花升空高度和爆点位置;用HiResTimer保证帧率稳定不掉帧;MyTexture模块加载Particle.bmp作为粒子贴图;PARTICLE.RGB存基础颜色配置。工程基于VS2010/2012,调试版自带msvcr110d.dll,双击exe就能看到固定坐标点触发的多层扩散式烟花——从升空、爆裂到粒子

alpha的博客 246

LTspice仿真报错Timestep too small?5种实测有效的解决方法(附详细参数配置)

本文针对LTspice仿真中常见的“Timestep too small”报错,提供了5种经过实测有效的解决方案。从理解错误根源入手,详细介绍了调整求解器、仿真参数、优化精度容差、设置初始条件、为理想元件添加寄生参数以及使用高级指令等具体方法,并附有详细的参数配置步骤,帮助工程师快速定位并解决仿真收敛问题,提升电路设计效率。

weixin_29213655的博客 280

江科大51单片机笔记【1】单片机及开发板介绍

单片机,Micro Controller Unit,简称MCU,内部集成了CPU、RAM、ROM、定时器、中断系统、通讯接口等一系列电脑的常用硬件功能单片机的任务是信息采集(传感器)、处理(CPU)和硬件设备(电机、LED)的控制单片机算是一个袖珍版计算机,是一个完整的计算机系统,成本低体积小结构简单单片机的使用领域:智能仪表、实时工控、通讯设备、导航系统、家用电器等。

2301_80195807的博客 833

ARCGIS绘制全国各省PM2.5浓度图操作步骤

ArcGIS新手小白一枚,经常需要帮助老师绘制一些简单的空间图,利用ArcGIS绘制全国各省的pm2.5浓度图,简单又方便,不记下来会忘记~

weixin_43458484的博客 1万+

Harness设计——Anthropic实战:规划器、生成器、评估器三角色协作详解

本文探讨了如何通过多智能体架构突破AI编码的瓶颈问题。文章首先分析了当前AI编码面临的两大核心挑战:上下文窗口限制导致的连贯性丧失,以及自我评估机制缺失引发的质量判断偏差。针对这些问题,作者提出了基于生成对抗网络(GAN)灵感的解决方案,设计了三智能体系统:规划器负责需求分析,生成器执行编码任务,评估器进行质量审查。 实验表明,在前端设计任务中,通过制定可量化的评分标准(设计质量、原创性、工艺、功能性)并建立生成-评估反馈循环,能显著提升输出质量。这种架构随后被扩展到全栈开发领域,采用类似敏捷开发的&quo

oe1019的专栏 867

Windows窗口编程中的WM_PAINT、WM_ERASEBKGND、InvalidateRect、UpdateWindow、BeginPaint和EndPaint等函数详解

Windows窗口编程中的WM_PAINT、WM_ERASEBKGND、InvalidateRect、UpdateWindow、BeginPaint和EndPaint等函数详解

dvlinker的技术专栏 7165

【yolo】如何在 YOLOv8 中添加负样本以减少误检

在YOLOv8目标检测中,误检(False Positive)是一个常见问题,即模型将非目标区域错误识别为目标。通过引入负样本(Negative Samples),即不包含任何目标框的图像,可以有效减少误检。在YOLOv8中添加负样本的方法是为这些图像提供空的标注文件(.txt),确保每张图像都有对应的标注文件,即使内容为空。可以使用Python脚本自动生成这些空标注文件。使用负样本时需注意数量比例、标注一致性、验证集同步和图像质量。适当加入负样本能显著提升模型鲁棒性,降低误判风险。

songhuangong123的博客 2879

基于YOLO-world训练模型的完整教程:从数据准备到微调训练

本文提供了YOLO-world模型训练的完整教程,涵盖从环境配置到微调训练的全流程。首先介绍了YOLO-world项目的安装与配置步骤,包括依赖安装和CUDA环境设置;接着详细说明了数据集的准备方法,包括COCO格式数据集的组织结构和自定义数据集的类别定义;然后阐述了配置文件的修改要点,包括超参数调整和数据集路径设置;最后讲解了训练命令的使用方法及常见问题的解决方案。本教程旨在帮助读者快速掌握YOLO-world模型的训练技能,适用于计算机视觉领域的研究人员和开发者。

FJN110的博客 1108

[HBM] RAM Cell Self Repair | 内存单元自我修复

对抗错误的大都是冗余,内存颗粒在设计的时候也考虑增加冗余。具体的说:添加冗余或备用的存储单元行和列,及时将测试中的故障进行修复和替换,存储器修复包括行修复,列修复或两者的组合。

串起点滴 785

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

下一篇: Leetcode :Sort List
XjtrX
博客等级 码龄18年 23粉丝 12原创
评论 13
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值