Memorandums

知覚・認知心理学の研究と教育をめぐる凡庸な日々の覚書

PTB-3: OS9 からの変更点

2007-07-24 | PsychToolBox
>> edit moviedemo
:
The comments below review the difference between the OS 9 version of
the toolbox and PTB-3.

New and different on OS Psychtoolbox:

The OS 9 Psychtoolbox is based on QuickTime and PTB-3 is
based on OpenGL. Differences between these underlying graphics libraries
have unavoidably resulted in differences between the OS 9 and PTB-3
versions of Screen; Some subfunctions of OS 9 Screen are replaced by
similar, but not identical functions in PTB-3.

In OS 9: /// In PTB-3

WaitBlanking /// Flip
PutImage /// MakeTexture
CopyWindow /// DrawTexture

PTB-3 は使いやすくなった(MATLAB R2007aは、というべきか)のだが、OS 9 版からのプログラムの修正がやや面倒だ。以下のサンプルを参考にすればわかりやすい。それでも少し時間が必要と思われる。
cf.
MovieDemo.m

Animation loops: OS 9 VS PTB-3

To understand the differences between OS 9 and PTB-3 Screen its helpful
to compare animation loops:

OS 9:

%create and fill offscreen windows here...
for i=1:numberOfMovieFrames
Screen(window, 'WaitBlanking');
Screen('CopyWindow', offscreenWindow(i), window);
end

PTB-3:

%generate textures here...
for i=1:numberOfMovieFrames
Screen('DrawTexture', texture(i), window);
Screen(window, 'Flip');
end
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする