mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-29 15:18:38 -05:00
Merge pull request #34 from cjcliffe/issue33-linux-setcurrent
GL context init fixes and warning cleanup
This commit is contained in:
commit
3657ce38bc
@ -237,7 +237,6 @@ include_directories (
|
||||
${PROJECT_SOURCE_DIR}/src
|
||||
${PROJECT_SOURCE_DIR}/external/rtaudio
|
||||
${PROJECT_SOURCE_DIR}/external/lodepng
|
||||
${PROJECT_SOURCE_DIR}/external/fastlz
|
||||
${PROJECT_SOURCE_DIR}/external/tinyxml
|
||||
)
|
||||
|
||||
|
@ -559,4 +559,6 @@ bool AppFrame::loadSession(std::string fileName) {
|
||||
|
||||
GetStatusBar()->SetStatusText(wxString::Format(wxT("Loaded session file: %s"), currentSessionFile.c_str()));
|
||||
SetTitle(wxString::Format(wxT("%s: %s"), CUBICSDR_TITLE, filePart.c_str()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -122,8 +122,6 @@ PrimaryGLContext& CubicSDR::GetContext(wxGLCanvas *canvas) {
|
||||
}
|
||||
glContext = m_glContext;
|
||||
|
||||
glContext->SetCurrent(*canvas);
|
||||
|
||||
return *glContext;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
class CubicSDR: public wxApp {
|
||||
public:
|
||||
CubicSDR() :
|
||||
m_glContext(NULL), frequency(DEFAULT_FREQ), sdrThread(NULL), sdrPostThread(NULL), threadCmdQueueSDR(NULL), iqVisualQueue(NULL), iqPostDataQueue(NULL), audioVisualQueue(NULL), t_SDR(NULL), t_PostSDR(NULL), sampleRate(DEFAULT_SAMPLE_RATE) {
|
||||
m_glContext(NULL), frequency(DEFAULT_FREQ), sdrThread(NULL), sdrPostThread(NULL), threadCmdQueueSDR(NULL), iqVisualQueue(NULL), iqPostDataQueue(NULL), audioVisualQueue(NULL), t_SDR(NULL), t_PostSDR(NULL), sampleRate(DEFAULT_SAMPLE_RATE), offset(0) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,6 @@ void DemodulatorInstance::setFrequency(long long freq) {
|
||||
command.llong_value = freq;
|
||||
threadQueueCommand->push(command);
|
||||
}
|
||||
demodulatorPreThread->getParams().bandwidth;
|
||||
}
|
||||
|
||||
long long DemodulatorInstance::getFrequency() {
|
||||
|
@ -100,6 +100,8 @@ void DemodulatorPreThread::threadMain() {
|
||||
case DemodulatorThreadCommand::DEMOD_THREAD_CMD_SET_FREQUENCY:
|
||||
params.frequency = command.llong_value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -227,6 +229,8 @@ void DemodulatorPreThread::threadMain() {
|
||||
params.bandwidth = result.bandwidth;
|
||||
params.sampleRate = result.sampleRate;
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -243,6 +247,10 @@ void DemodulatorPreThread::threadMain() {
|
||||
tCmd.context = this;
|
||||
threadQueueNotify->push(tCmd);
|
||||
std::cout << "Demodulator preprocessor thread done." << std::endl;
|
||||
|
||||
#ifdef __APPLE__
|
||||
return this;
|
||||
#endif
|
||||
}
|
||||
|
||||
void DemodulatorPreThread::terminate() {
|
||||
|
@ -410,6 +410,10 @@ void DemodulatorThread::threadMain() {
|
||||
tCmd.context = this;
|
||||
threadQueueNotify->push(tCmd);
|
||||
std::cout << "Demodulator thread done." << std::endl;
|
||||
|
||||
#ifdef __APPLE__
|
||||
return this;
|
||||
#endif
|
||||
}
|
||||
|
||||
void DemodulatorThread::setVisualOutputQueue(DemodulatorThreadOutputQueue *tQueue) {
|
||||
|
@ -27,6 +27,8 @@ void DemodulatorWorkerThread::threadMain() {
|
||||
filterChanged = true;
|
||||
filterCommand = command;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
done = commandQueue->empty();
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ void MeterCanvas::setMax(float max_in) {
|
||||
level_max = max_in;
|
||||
}
|
||||
|
||||
bool MeterCanvas::setInputValue(float slider_in) {
|
||||
void MeterCanvas::setInputValue(float slider_in) {
|
||||
userInputValue = inputValue = slider_in;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public:
|
||||
|
||||
void setMax(float max_in);
|
||||
|
||||
bool setInputValue(float slider_in);
|
||||
void setInputValue(float slider_in);
|
||||
bool inputChanged();
|
||||
float getInputValue();
|
||||
|
||||
|
@ -4,14 +4,12 @@
|
||||
|
||||
MeterContext::MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext) {
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
void MeterContext::DrawBegin() {
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
glClearColor(ThemeMgr::mgr.currentTheme->generalBackground.r, ThemeMgr::mgr.currentTheme->generalBackground.g, ThemeMgr::mgr.currentTheme->generalBackground.b, 1.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
|
@ -53,14 +53,14 @@ void PrimaryGLContext::CheckGLError() {
|
||||
|
||||
PrimaryGLContext::PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext) :
|
||||
wxGLContext(canvas, sharedContext) {
|
||||
SetCurrent(*canvas);
|
||||
#ifndef __linux__
|
||||
// Pre-load fonts
|
||||
for (int i = 0; i < GLFONT_MAX; i++) {
|
||||
getFont((GLFontSize) i);
|
||||
}
|
||||
CheckGLError();
|
||||
#endif
|
||||
//#ifndef __linux__
|
||||
// SetCurrent(*canvas);
|
||||
// // Pre-load fonts
|
||||
// for (int i = 0; i < GLFONT_MAX; i++) {
|
||||
// getFont((GLFontSize) i);
|
||||
// }
|
||||
// CheckGLError();
|
||||
//#endif
|
||||
}
|
||||
|
||||
GLFont &PrimaryGLContext::getFont(GLFontSize esize) {
|
||||
@ -86,6 +86,9 @@ GLFont &PrimaryGLContext::getFont(GLFontSize esize) {
|
||||
case GLFONT_SIZE48:
|
||||
fontName = "vera_sans_mono48.fnt";
|
||||
break;
|
||||
default:
|
||||
fontName = "vera_sans_mono12.fnt";
|
||||
break;
|
||||
}
|
||||
|
||||
fonts[esize].loadFont(fontName);
|
||||
|
Loading…
Reference in New Issue
Block a user