|
|
|
windows 核心编程看不懂啊,怎么办
与其说是看不懂,其实是你现在做的东西用不上这里面的东西,你主动的去“硬看”。 看不懂就放下吧。你需要去看懂的时候,自然而然的就会去主动的查找,找到了就会“秒懂”。 |
|
[求助]子进程获取父进程名称的问题
看着像撸啊撸。。。 |
|
PostMessage发送中文字符串
PostMessage发送消息就带两个参数wParam 和lParam,传中文比较难了,传指针还差不多。 注意指针对象的生命周期。 |
|
[求助]编程路,两茫茫,求一师傅来帮忙
论坛有本书,叫《Windows编程循序渐进》,照着这本书,把书中的代码敲一遍,尤其是一看就会,已经弄懂了的代码,一定要敲一般,运行过一次,然后windows的框架大概就没问题了。 这个是基础,然后可以再找个驱动开发(内核)的书看看,比如寒江独钓什么的,内核的话,最好给自己找个目标,比如要做个小端口网络过滤,文件过滤什么的。然后就是windbg或者ollydbg什么的 ,这时候可以看看天书夜读(真是天书,也真是夜读,起早贪黑的看,专制失眠)。 我个人觉得路线可以是这么个路线,实际上,《Windows编程循序渐进》敲完之后,基本就是天高任鸟飞了,因为VS怎么使用,你基本已经掌握了,呵呵。 |
|
[注意]多人游戏同步的问题
程序上,并没有侦这个概念的。 拿D3D的Win32游戏程序来说,绘图函数Vender()的位置一般在消息处理结束的地方,也就是下面这样: LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; switch (message) { case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // 分析菜单选择: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: 在此添加任意绘图代码... EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } /////////////////////////////////////////////////////////////////////////////////////////////// Vender();//没什么消息需要处理的话,那我就绘图吧 /////////////////////////////////////////////////////////////////////////////////////////////// return 0; } 上面是Windows程序的消息处理过程,在处理过程的末尾,有一个绘图函数Vender(),这个绘图函数是要自己实现的。 也就是说,没有消息需要处理的话,我就绘图。这也就是为什么性能高的机器,FPS就高的原因。因为Vender()完成的速度在不同性能的机器上完成的时间是不一样的。配置低的机器一秒钟仅能完成几次(FPS只有几)。 程序里,可能会在Vender()保存一个自身被调用次数计数的变量,但是Vender()被调用多少次实际上程序多半是不怎么关心的,可能也是不可控的(如果可控,那么配置低的机器也能实现很高的FPS。当然,程序里人为的降低FPS还是没问题的,提高的话就很难)。 所以,你说的绘图是根据第几侦这个说法,其实是不正确的。 简单的说, 比如,第一侦绘制, 性能高的电脑: 仅需要0.001s就完成了Vender(),,然后没有新的消息到来,那么就绘制第二侦,这时所有的参数都还没有变化,所以Vender()绘制的第二侦跟第一侦完全一样。 性能低的电脑: 需要3秒钟才完成Vender(),然后前面已经有很多消息到来,并且已经处理了。非常多的参数都变化了,然后又调用Vender(),绘制第二侦,这个第二侦跟第一侦区别非常多了(游戏里面的卡屏,哈哈,第一侦刚扬起刀,画面停滞3秒钟之后,你被砍死了。实际上如果是你被砍死了,而不是一直在逻辑上砍杀的话,说明这个程序写的有问题,因为绘图阻塞了逻辑处理。更好的处理方法是分别用不同的后台线程去处理,或者逻辑运算交给服务器,绘图、表现交给客户机去实现,这样画面更流畅,对防作弊也有一定好处,当然,对网络环境要求也高了很多。像是剑网三,不只这些,剑网三的逻辑和绘图除了把逻辑运算放到服务器,本地绘图还有一个“呼吸”的概念,这样可以运行lua脚本,思想非常先进)。 可以看到,同样的程序,同样的第二侦,运行的内容却是不一样的。 上面的例子就说明了你的关于游戏绘图的理解是不正确的。 至于FPS统计,如果是游戏本身的统计,那么在绘图里搞个计数器就好了。如果是外挂式的,统计的地点是不在这里的。多半会统计某个显卡驱动或者系统的API什么的吧 |
|
[求助]请教下界面问题
directUI库(库的话,3楼有介绍)或者自绘,自绘的话Gdi , Gdi+, DirectDraw, Direct3D都可以实现,3楼提到的闪烁问题,理解了Windows的绘图机制,就很容易消除了(双缓冲,后台绘图什么的)。 |
|
[原创]国庆时完工的反汇编引擎源码
成功保住小JJ,哈哈。怕怕滴 |
|
|
|
[分享]黑龙江抓捕超大上万台电脑工作室 JC叔叔说他们的电脑一架只要300块
估计不会用硬盘的。无盘系统最适合这种集群环境布置了。 |
|
关于ebp和esp的关系
我都是把EBP当作基址,ESP在EBP上盖楼来理解的。所以某个函数或者进程什么的要崩溃,你就崩到EBP就好了,超过EBP就不是你的东西了。当然EBP,ESP要存放到一个安全的地方,不那么容易丢失的地方,所以才会有那么多的push ebp mov ebp,esp. 简单说,就是这两个寄存器保存着你程序在哪段内存上运行的信息。 |
|
[注意]多人游戏同步的问题
不知道我理解的是不是对的。 像是GDI(+)或者DirectDraw里,都是有后备页(双缓冲)的,绘制的时候在后备页里绘制,刷新的时候GDI好像需要编程将后备页绘制到前台页面,DirectDraw是交换指针(将N个后备页中的要显示页和前台页指针交换),这个动作都是很快的。 而绘制后备页的动作都是由程序控制了。比如AB互砍这个动作,在编程的时候就应该设计好绘图框架(或者使用游戏引擎),对绘制的每一帧都进行控制,即:绘制当前帧时,查询一下有多少个绘制对象(地图、场景效果、人物etc),检查各个对象当前状态(如地图,如果人物没有走动,那么绘制过程就不需要全部绘制,仅仅更新一下人物所占的那一小块面积即可),然后根据整个检查结果安排绘制。 就AB互砍来说, 第一帧绘制A砍杀动作的第一帧,更新显示。 第二帧绘制A砍杀动作的第二帧,更新显示。 第三帧绘制A砍杀动作的第三帧,并且查询到B的状态改变了,绘制B砍杀动作的第一帧,更新显示。 ... 所有绘制对象的状态改变等等并不与绘制同一线程。 服务器处理的仅仅是接收AB发出砍人动作的命令,计算伤害,返回给客户端。至于客户端怎么绘图,服务器不去处理的。客户端接收到服务器的返回,改变自己绘图对象的状态就可以了,然后绘图动作查询对象状态,根据对象状态绘制游戏画面。 |
|
[讨论]这里有多少人请数字软件或者金山驻扎自己的电脑呢?
痛快还是痛苦?? 电脑资源耗尽,搞个什么东西都弹你一下,烦人的很。好不容易有个思路了,噫?什么玩意儿跳出来了?哦,是XX这个SB软件提示你后台有N可空闲进程和服务可清理,不理他,嗯????他妈比的我刚才想到哪里了???这个EAX里是什么??草他妈!!! 我什么也不装,裸奔了10来年了。。。 |
|
[建议]希望能有破解视频教程栏目
书非借不能读也,我觉得不搞视频也挺好。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值