CubicSDR/src/PrimaryGLContext.h

60 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include "wx/glcanvas.h"
#include "wx/timer.h"
#include <vector>
#include "CubicSDRDefs.h"
#include "fftw3.h"
2014-11-04 23:05:04 -05:00
#include "Demodulate.h"
2014-11-05 19:10:18 -05:00
#include <AL/al.h>
#include <AL/alc.h>
class PrimaryGLContext: public wxGLContext {
public:
PrimaryGLContext(wxGLCanvas *canvas);
void Plot(std::vector<float> &points,std::vector<float> &points2);
private:
// textures for the cube faces
GLuint m_textures[6];
};
class TestGLCanvas: public wxGLCanvas {
public:
TestGLCanvas(wxWindow *parent, int *attribList = NULL);
2014-11-05 19:10:18 -05:00
~TestGLCanvas();
void setData(std::vector<signed char> *data);
private:
void OnPaint(wxPaintEvent& event);
void OnKeyDown(wxKeyEvent& event);
void OnIdle(wxIdleEvent &event);
wxWindow *parent;
std::vector<float> spectrum_points;
std::vector<float> waveform_points;
fftw_complex *in, *out[2];
fftw_plan plan[2];
float fft_ceil_ma, fft_ceil_maa;
std::vector<float> fft_result;
std::vector<float> fft_result_ma;
std::vector<float> fft_result_maa;
2014-11-04 23:05:04 -05:00
Demodulate demod;
2014-11-05 19:10:18 -05:00
ALCdevice *dev;
ALCcontext *ctx;
wxDECLARE_EVENT_TABLE();
};