简体   繁体   English

在不使用OpenGL,Vulkan等的情况下,用C ++创建基于2D Sprite的游戏

[英]Creating a 2D Sprite Based Game in C++ without OpenGL, Vulkan, etc

This might not be the best place to pose this question. 这可能不是提出此问题的最佳位置。 Just a warning. 只是警告。 Anyways, continue. 无论如何,继续。 I was wondering if there is a way to make a simple 2D game purely using the command prompt without any graphics libraries like OpenGL and Vulkan, as I have already made a fairly adequate real-time game engine with OpenGL and Vulkan. 我想知道是否有一种方法可以纯粹使用命令提示符来制作简单的2D游戏,而没有像OpenGL和Vulkan这样的任何图形库,因为我已经使用OpenGL和Vulkan制作了相当不错的实时游戏引擎。 Just for a little bit of extra information, I am on Windows and have a fairly large understanding of most advanced C++ topics. 仅需一点点额外的信息,我就在Windows上,并且对大多数高级C ++主题有相当大的了解。 Are there any API functions where I can draw pixels directly to the console? 是否有API函数可以直接将像素绘制到控制台? I have seen that used before but didn't fully understand how to use it. 我以前曾经看过它,但并不完全了解如何使用它。

By "2D sprite-based", I'm guessing you want to have actual raster graphics and not ascii graphics (ie text-based ) 通过“基于2D子画面”,我猜您想拥有实际的栅格图形而不是ascii图形(即基于文本的

If you're going to do this, you need to have a way to interface with the integrated graphics hardware or card. 如果要执行此操作,则需要一种与集成的图形硬件或卡接口的方法。

On Windows, there is the GDI. 在Windows上,有GDI。

I would get started with this link. 我将从这个链接开始。 Microsoft GDI Microsoft GDI

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

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