RtAudio tweaks, disable unused GL states

This commit is contained in:
Charles J. Cliffe 2014-12-05 18:20:28 -05:00
parent 24b3b81f34
commit 051c4f081f
5 changed files with 14 additions and 7 deletions

View File

@ -47,6 +47,7 @@ bool CubicSDR::OnInit() {
AppFrame *appframe = new AppFrame();
#ifdef __APPLE__
int main_policy;
struct sched_param main_param;
@ -54,6 +55,7 @@ bool CubicSDR::OnInit() {
main_param.sched_priority = sched_get_priority_min(SCHED_OTHER);
pthread_setschedparam(pthread_self(), main_policy, &main_param);
#endif
return true;
}

View File

@ -59,8 +59,13 @@ void AudioThread::threadMain() {
unsigned int sampleRate = AUDIO_FREQUENCY;
unsigned int bufferFrames = 256;
RtAudio::StreamOptions opts;
opts.flags = RTAUDIO_MINIMIZE_LATENCY | RTAUDIO_SCHEDULE_REALTIME;
opts.streamName = "CubicSDR Audio Output";
opts.priority = 0;
try {
dac.openStream(&parameters, NULL, RTAUDIO_FLOAT32, sampleRate, &bufferFrames, &audioCallback, (void *) this);
dac.openStream(&parameters, NULL, RTAUDIO_FLOAT32, sampleRate, &bufferFrames, &audioCallback, (void *) this, &opts);
dac.startStream();
} catch (RtAudioError& e) {
e.printMessage();

View File

@ -4,8 +4,8 @@
ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext) :
PrimaryGLContext(canvas, sharedContext) {
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

View File

@ -4,8 +4,8 @@
SpectrumContext::SpectrumContext(SpectrumCanvas *canvas, wxGLContext *sharedContext) :
PrimaryGLContext(canvas, sharedContext) {
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

View File

@ -4,8 +4,8 @@
WaterfallContext::WaterfallContext(WaterfallCanvas *canvas, wxGLContext *sharedContext) :
PrimaryGLContext(canvas, sharedContext) {
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();