游戏开发论坛

 找回密码
 立即注册
搜索
查看: 4674|回复: 17

游戏编程VB转到C++!遇到问题!!各位高手请。。。?

[复制链接]

13

主题

66

帖子

86

积分

注册会员

Rank: 2

积分
86
QQ
发表于 2005-11-8 10:34:00 | 显示全部楼层 |阅读模式
朋友们,我以前Vb & DX7编游戏的,但听说C++是编游戏的最强语言。所以最近开始C++编游戏了,但毕竟是新手,遇到了问题。前看一下下面的程序,不知道后面怎么写。也就是一个800*600*24的背景图片上显示一张精灵的静态图片。必须DX7的,多余的程序部分先不要。只把上面的功能实现就行了。请各位高手补充程序上转一下好吗??? [em6] [em7]

sf_2005118103417.rar

11.59 KB, 下载次数:

3

主题

105

帖子

105

积分

注册会员

Rank: 2

积分
105
发表于 2005-11-8 15:04:00 | 显示全部楼层

Re:游戏编程VB转到C++!遇到问题!!各位高手请。。。?

接下来你要做的是创建一个窗口,然后创建好DirectDraw的接口 接着就开始实现你要的功能了。
才刚刚开始,朋友

13

主题

66

帖子

86

积分

注册会员

Rank: 2

积分
86
QQ
 楼主| 发表于 2005-11-9 04:45:00 | 显示全部楼层

Re:游戏编程VB转到C++!遇到问题!!各位高手请。。。?

楼2的朋友。谢谢你的指教!!!
我以前是用VB & Dx7 写游戏的。这个程序是我的第一个C++程序。所以我不了解窗口怎么创建,DDraw接口怎么创建。所以你(楼2)可以的话,帮忙我补充我的程序上转好吗?如果能帮助的话我非常非常感谢你!!!

0

主题

9

帖子

9

积分

新手上路

Rank: 1

积分
9
发表于 2005-11-10 09:25:00 | 显示全部楼层

Re: 游戏编程VB转到C++!遇到问题!!各位高手请。。。?

发给你一个c版的dx显示静态图片的程序代码。因为我没有做过c++的。你可以看起来。
这个引擎是Tricks of the Windows Game Programming Gurus - 2nd Edition作者André LaMothe自己写的。

sf_200511109256.rar

134.38 KB, 下载次数:

13

主题

66

帖子

86

积分

注册会员

Rank: 2

积分
86
QQ
 楼主| 发表于 2005-11-11 04:21:00 | 显示全部楼层

Re:游戏编程VB转到C++!遇到问题!!各位高手请。。。?

谢谢楼4!

13

主题

66

帖子

86

积分

注册会员

Rank: 2

积分
86
QQ
 楼主| 发表于 2005-11-11 04:23:00 | 显示全部楼层

Re:游戏编程VB转到C++!遇到问题!!各位高手请。。。?

怎么我编译C/C++程序就出现这个错问题?!

c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(175) : error C2146: syntax error : missing ';' before identifier 'images'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(175) : error C2501: 'LPDIRECTDRAWSURFACE7' : missing storage-class or type specifiers
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(175) : error C2501: 'images' : missing storage-class or type specifiers
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2065: 'LPDIRECTDRAWSURFACE7' : undeclared identifier
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2146: syntax error : missing ')' before identifier 'lpdds'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2440: 'initializing' : cannot convert from 'int' to 'struct IDirectDrawClipper *'
        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2059: syntax error : ')'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(309) : error C2146: syntax error : missing ';' before identifier 'DDraw_Create_Surface'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(309) : error C2501: 'LPDIRECTDRAWSURFACE7' : missing storage-class or type specifiers
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(309) : fatal error C1004: unexpected end of file found
t3dlib1.cpp
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(175) : error C2146: syntax error : missing ';' before identifier 'images'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(175) : error C2501: 'LPDIRECTDRAWSURFACE7' : missing storage-class or type specifiers
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(175) : error C2501: 'images' : missing storage-class or type specifiers
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2065: 'LPDIRECTDRAWSURFACE7' : undeclared identifier
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2146: syntax error : missing ')' before identifier 'lpdds'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2440: 'initializing' : cannot convert from 'int' to 'struct IDirectDrawClipper *'
        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2059: syntax error : ')'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(309) : error C2146: syntax error : missing ';' before identifier 'DDraw_Create_Surface'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(309) : error C2501: 'LPDIRECTDRAWSURFACE7' : missing storage-class or type specifiers
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(309) : fatal error C1004: unexpected end of file found
t3dlib2.cpp
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(175) : error C2146: syntax error : missing ';' before identifier 'images'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(175) : error C2501: 'LPDIRECTDRAWSURFACE7' : missing storage-class or type specifiers
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(175) : error C2501: 'images' : missing storage-class or type specifiers
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2065: 'LPDIRECTDRAWSURFACE7' : undeclared identifier
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2146: syntax error : missing ')' before identifier 'lpdds'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2440: 'initializing' : cannot convert from 'int' to 'struct IDirectDrawClipper *'
        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(308) : error C2059: syntax error : ')'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(309) : error C2146: syntax error : missing ';' before identifier 'DDraw_Create_Surface'
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(309) : error C2501: 'LPDIRECTDRAWSURFACE7' : missing storage-class or type specifiers
c:\documents and settings\osman\桌面\sf_200511109256\t3dlib1.h(309) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

physical.exe - 30 error(s), 0 warning(s)

13

主题

66

帖子

86

积分

注册会员

Rank: 2

积分
86
QQ
 楼主| 发表于 2005-11-11 04:25:00 | 显示全部楼层

Re:游戏编程VB转到C++!遇到问题!!各位高手请。。。?

说实在的话,我讨厌C++了。还是VB好!!!

9

主题

25

帖子

25

积分

注册会员

Rank: 2

积分
25
发表于 2005-11-11 08:47:00 | 显示全部楼层

Re:游戏编程VB转到C++!遇到问题!!各位高手请。。。?

可能是头文件的问题吧

3

主题

105

帖子

105

积分

注册会员

Rank: 2

积分
105
发表于 2005-11-11 16:34:00 | 显示全部楼层

Re:游戏编程VB转到C++!遇到问题!!各位高手请。。。?

     呵呵 还是楼主自己写比较好吧   既然想用VC++, 就一切从头开始吧

121

主题

2029

帖子

2034

积分

金牌会员

Rank: 6Rank: 6

积分
2034
QQ
发表于 2005-11-11 16:45:00 | 显示全部楼层

Re:游戏编程VB转到C++!遇到问题!!各位高手请。。。?

......一点都不了解就开始讨厌这样东西。。。。。。认真点好不好。。。。。。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-22 16:39

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表