SDL窗口似乎被操作系统错误地标记为“无响应” [英] SDL window seemingly improperly being marked 'unresponsive' by OS

查看:138
本文介绍了SDL窗口似乎被操作系统错误地标记为“无响应”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过Derelict 3访问的SDL2窗口窗口。



它应该选通黑色和白色(不是因为我讨厌癫痫病),并且它可以成功完成此操作。但是,在一段时间后,Ubuntu 13.10将窗口标记为无响应,将其显示为灰色,并减弱了频闪效果。



这非常令人恼火,并且完全



如何使我的OS意识到窗口正在执行其应有的功能,因此消除了视觉刺激应用程序所需的效果。





代码



当我将SDL调用包装在实际代码中时,将提供在这些部分中调用的伪代码和SDL方法(我检查了我是否正在调用任何其他SDL函数):

 使用SDL_CreateWindow创建一个窗口(未设置标志)
使用SDL_CreateRenderer创建一个渲染器(设置presentvsync标志)
for(...)
{
使用SDL_RenderFillRect和SDL_SetRenderDrawColor
黑色填充屏幕,使用SDL_RenderPresent
白色填充屏幕(与上述填充相同)
更新屏幕(与上述更新相同)
}
退出

我认真地检查了错误代码并返回了包装库lib中所有SDL调用的值。都很好我需要知道的是我必须添加什么才能为我的操作系统提供心跳,以便它停止使窗口变灰。



另一件事...



有人可以添加SDL2标签吗? SDL2具有与SDL1.2完全不同的API ...

解决方案

通过 SDL_PollEvent(null)。这使操作系统满意。


I have an SDL2 windowed window accessed via Derelict 3.

It is supposed to strobe black and white (not because I hate epileptics), and it does this successfully. However, after a certain period of time, Ubuntu 13.10 marks the window as 'unresponsive', grays it out, and dulls the strobe effect.

This is highly irritating and totally kills the effect required by the application for visual stimulation to retrieve SSVEP readings from my EEG headset.

How do I get my OS to realize that the window is doing exactly what it should be doing?

Code

As I have wrapped the SDL calls in my actual code, I'm going to provide pseudo-code and the SDL methods called in those sections (I've checked that I'm not calling any other SDL functions):

make a window using SDL_CreateWindow (no set flags)
make a renderer using SDL_CreateRenderer (with presentvsync flag set)
for( ... )
{
  fill screen black using SDL_RenderFillRect and SDL_SetRenderDrawColor
  update screen using SDL_RenderPresent
  fill screen white (same as above filling)
  update screen (same as above update)
}
exit

I pedantically check error codes and return values for all SDL calls in the wrapper lib. They're all fine. What I need to know is what I must add to provide the heartbeat to my OS so it stops graying out my window.

Another thing...

Could someone please add an SDL2 tag? SDL2 has a very different API from SDL1.2...

解决方案

Added event processing into the loop via SDL_PollEvent(null). This satisfied the OS.

这篇关于SDL窗口似乎被操作系统错误地标记为“无响应”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆