简体   繁体   English

记住创建空白win32窗口的所有内容是很重要的

[英]Is it important to memorize everything that goes into creating a blank win32 window

Currently i have a general idea of what every line of code in a blank win32 program but, if you were to sit me in a room with no a computer, mouse, keyboard and open notepad, i would not be able to write a win32 blank window. 目前我对一个空白的win32程序中的每一行代码都有一个大概的想法,但是,如果你让我坐在一个没有电脑,鼠标,键盘和打开记事本的房间里,我将无法写一个win32空白窗口。 Also to add on that, I probably wouldn't remember every WNDCLASSEX member variables. 另外,我可能不会记得每个WNDCLASSEX成员变量。

So do you believe that I should memorize every bit of syntax? 所以你相信我应该记住每一点语法吗? Or is a general idea of every line of code good enough? 或者是对每行代码足够好的一般概念?

This question was inspired to me when my book asked my to copy and paste the code from the blank window to the new project. 当我的书要求我将代码从空白窗口复制并粘贴到新项目时,这个问题就受到了启发。 I thought to myself, "I wonder if successful game programmers write out the code for every part of their project". 我心想,“我想知道成功的游戏程序员是否会为他们项目的每个部分编写代码”。

I am currently reading Beginning 3D game programming with DirectX and i am getting the preliminaries out of the way. 我目前正在阅读使用DirectX开始3D游戏编程,我正在开始预备。

Thank you for your insight. 感谢您的见解。

Depends on what you are trying to do. 取决于你想要做什么。 The general answer is no, with some caveats. 一般的答案是否定的,有一些警告。 If you are making a general Windows program, and not a game like you've described, there are about a dozen other ways to make a window with less pain. 如果你正在制作一般的Windows程序,而不是像你所描述的那样的游戏,那么还有其他十几种方法可以让你的窗口更轻松。

A lot of game developers simply keep a boilerplate project file with this stuff set up. 很多游戏开发人员只是设置了这个东西的样板项目文件。 It doesn't hurt to know what it means though. 知道它意味着什么并没有什么坏处。 I have some Visual studio project files I use for games/visuals that I start from so I don't have to remember all of this. 我有一些Visual Studio项目文件,我用它来开始游戏/视觉效果,所以我不必记住所有这些。

Do you need to memorize it? 你需要记住它吗? No. 没有。

Are you going to write that code out again for every program? 您是否要为每个程序再次编写该代码? No. 没有。

Will you even copy+paste that into every program? 你会复制+粘贴到每个程序吗? Probably not. 可能不是。

But understanding how it is done is essential to making effective use of a library that performs these mundane tasks for you. 但了解它是如何完成的,对于有效使用为您执行这些平凡任务的库至关重要。 You'll understand where the possible extension points are and what options are available. 您将了解可能的扩展点的位置以及可用的选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM