English 中文(简体)
如何在屏幕上读一个星子?
原标题:How to read a pixel off of the screen?

我正试图为一场网络游戏打一个简单的机器人,因此,我希望能够在屏幕上读一个星子的颜色。 我与GetPixel(GetPixel)一起在Windows上做了这项工作,但我似乎无法在SOS X上看到这一点。 我在网上看望,走过冰川。 当我在锡卡德成为一条简单的指挥线工具时,我提出了以下守则。 然而,我似乎不能让它发挥作用。 我不断发现EXC_BAD_ACCESS错误:

GLfloat r;
glReadPixels(0, 0, 1, 1, GL_RED, GL_FLOAT, &r);

我认为,上述法典将把钢材的红色价值(0,0)储存起来。 吴 Oh,我想避免采取 screen击的做法,因为这很缓慢。 任何帮助?

P.S. 有了指挥线工具,我的最终目标是制作双管或辅助器,因为我已经拥有可以点击屏幕的指挥线工具。

问题回答

glReadPixels is only concern about Read a pixel from the framework.5/53/ (the area to which Yougrams card].

从“屏幕”中读取的颜料根本与开放式GL无关。 你们需要具体系统的职能。





相关问题
2 mysql instances in MAC

i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is ...

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Controlling OSX windows

I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...

Switching J2SE versions on Mac OS (SnowLeopard)

My current JDK on Mac OS (10.6) is set to 1.6 and I d like to switch to 1.5. A listing of /System/Library/Frameworks/JavaVM.framework/Versions/ shows: lrwxr-xr-x 1 root wheel 10 Nov 3 18:34 ...

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

export to MP3 from quicktime API

A question for Apple,QT programmers. Would like to know if it s possible to export a Movie object to MP3 using the QuickTime API. Preferably the ConvertMovieToFile function. I ve looked at ...

热门标签