简体   繁体   English

C ++等效于直接在汇编中写入屏幕

[英]C++ equivalent to directly writing to screen in assembly

In 68000 assembly you utilised techniques to identify the screen address and then write your image to the screen. 在68000装配中,您利用了一些技术来识别屏幕地址,然后将图像写入屏幕。 I would like to know how this could be done using C++ or similar. 我想知道如何使用C ++或类似的方法来完成。 Can anyone help with this or point me at such a tutorial? 任何人都可以帮忙解决这个问题或向我指出这样的教程吗?

I used to develop small games/demos in 68000 assembly many years ago. 多年前,我曾经在68000组装中开发小型游戏/演示。 I've recently taught myself c++ as well as playing with c#. 我最近自学了c ++以及玩c#。 I appreciate there's openGL and Direct X available among many other libraries/engines that I could use to do the work for me but I'm simply interested in how I could essentially place a pixel not the screen at the lowest level within C++ or similar. 我很欣赏在许多其他库/引擎中都可以使用openGL和Direct X,这些库/引擎可以用来为我完成工作,但是我只是对我如何能够在C ++或类似系统中将像素而不是屏幕的最低级别感兴趣。 Its less practical but more educational for me. 它对我来说不太实用,但更具教育意义。

I'm assuming in a Windows environment I would be looking to use an OS API to do this but which? 我假设在Windows环境中,我希望使用OS API来做到这一点,但是哪一个呢? Or is my answer actually openGL or DirectX. 还是我的答案实际上是openGL或DirectX。 If so, whats the best method to place a single pixel on an otherwise blank display? 如果是这样,在空白显示器上放置单个像素的最佳方法是什么?

Thanks in advance.... 提前致谢....

Graphics is not part of standard C++. 图形不是标准C ++的一部分。 You have to use 3rd party libraries to do this. 您必须使用第三方库来执行此操作。 There are several choices. 有几种选择。 You already mentioned OpenGL and DirectX, which I consider quite low-level. 您已经提到了OpenGL和DirectX,我认为它们很底层。 If you want to go even lower level, you can use the API given by your OS. 如果您想更进一步,可以使用操作系统提供的API。

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

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