mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-27 21:07:50 +02:00
Fixed OpenGL memory leak
This commit is contained in:
@ -88,7 +88,7 @@ bool showMenu = true;
|
||||
dsp::stream<dsp::complex_t> dummyStream;
|
||||
|
||||
void windowInit() {
|
||||
spdlog::info("Initializing SoapySDR");
|
||||
gui::waterfall.init();
|
||||
|
||||
credits::init();
|
||||
|
||||
|
@ -107,6 +107,10 @@ namespace ImGui {
|
||||
updatePallette(COLOR_MAP, 13);
|
||||
}
|
||||
|
||||
void WaterFall::init() {
|
||||
glGenTextures(1, &textureId);
|
||||
}
|
||||
|
||||
void WaterFall::drawFFT() {
|
||||
// Calculate scaling factor
|
||||
float startLine = floorf(fftMax / vRange) * vRange;
|
||||
@ -361,7 +365,6 @@ namespace ImGui {
|
||||
}
|
||||
|
||||
void WaterFall::updateWaterfallTexture() {
|
||||
glGenTextures(1, &textureId);
|
||||
glBindTexture(GL_TEXTURE_2D, textureId);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
@ -51,6 +51,8 @@ namespace ImGui {
|
||||
public:
|
||||
WaterFall();
|
||||
|
||||
void init();
|
||||
|
||||
void draw();
|
||||
void pushFFT(std::vector<float> data, int n);
|
||||
|
||||
|
Reference in New Issue
Block a user