mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-02-03 09:44:26 -05:00
CubicVR2: more restricted operators on structures by removing convert-to-pointer. (Fix #550 ?)
This commit is contained in:
parent
56b56685e0
commit
3095f8205a
18
external/cubicvr2/math/mat3.h
vendored
18
external/cubicvr2/math/mat3.h
vendored
@ -12,7 +12,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "vec3.h"
|
#include "vec3.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <stddef.h>
|
||||||
namespace CubicVR {
|
namespace CubicVR {
|
||||||
|
|
||||||
#define mat3SG(c,x,y) \
|
#define mat3SG(c,x,y) \
|
||||||
@ -20,13 +20,19 @@ namespace CubicVR {
|
|||||||
c & COMBINE(set,x)(mat3 value) { y = value; return *this; }
|
c & COMBINE(set,x)(mat3 value) { y = value; return *this; }
|
||||||
|
|
||||||
struct mat3 {
|
struct mat3 {
|
||||||
|
|
||||||
__float a,b,c,d,e,f,g,h,i;
|
__float a,b,c,d,e,f,g,h,i;
|
||||||
|
|
||||||
// __float operator [] (unsigned i) const { return ((__float *)this)[i]; }
|
//access as-array:
|
||||||
#ifndef _WIN32
|
inline __float& operator [] (size_t i) {
|
||||||
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
|
__float* as_array = (__float*)this;
|
||||||
#endif
|
return (as_array[i]);
|
||||||
operator __float*() const { return (__float *)this; }
|
}
|
||||||
|
|
||||||
|
inline const __float& operator [] (size_t i) const {
|
||||||
|
__float* as_array = (__float*)this;
|
||||||
|
return (as_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
mat3(__float ai,__float bi,__float ci,__float di,__float ei,__float fi,__float gi,__float hi,__float ii) {
|
mat3(__float ai,__float bi,__float ci,__float di,__float ei,__float fi,__float gi,__float hi,__float ii) {
|
||||||
a = ai; b = bi; c = ci; d = di; e = ei; f = fi; g = gi; h = hi; i = ii;
|
a = ai; b = bi; c = ci; d = di; e = ei; f = fi; g = gi; h = hi; i = ii;
|
||||||
|
41
external/cubicvr2/math/mat4.h
vendored
41
external/cubicvr2/math/mat4.h
vendored
@ -15,21 +15,44 @@
|
|||||||
#include "vec4.h"
|
#include "vec4.h"
|
||||||
#include "mat3.h"
|
#include "mat3.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
namespace CubicVR {
|
namespace CubicVR {
|
||||||
using namespace std;
|
using namespace std;
|
||||||
#define mat4SG(c,x,y) \
|
#define mat4SG(c,x,y) \
|
||||||
mat4 COMBINE(get,x)() { return y; } \
|
mat4 COMBINE(get,x)() { return y; } \
|
||||||
c & COMBINE(set,x)(mat4 value) { y = value; return *this; }
|
c & COMBINE(set,x)(mat4 value) { y = value; return *this; }
|
||||||
|
|
||||||
struct mat4 {
|
struct mat4 {
|
||||||
__float a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;
|
|
||||||
|
|
||||||
// __float operator [] (unsigned i) const { return ((__float *)this)[i]; }
|
//16 elements
|
||||||
#ifndef _WIN32
|
__float a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p;
|
||||||
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
|
|
||||||
#endif
|
//access as-array:
|
||||||
|
inline __float& operator [] (size_t i) {
|
||||||
|
__float* as_array = (__float*)this;
|
||||||
|
return (as_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const __float& operator [] (size_t i) const {
|
||||||
|
__float* as_array = (__float*)this;
|
||||||
|
return (as_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//compare to ZERO-filled matrix
|
||||||
|
inline operator bool() const {
|
||||||
|
|
||||||
|
return (a != 0.0f || b != 0.0f || c != 0.0f || d != 0.0f ||
|
||||||
|
e != 0.0f || f != 0.0f || g != 0.0f || h != 0.0f ||
|
||||||
|
i != 0.0f || j != 0.0f || k != 0.0f || l != 0.0f ||
|
||||||
|
m != 0.0f || n != 0.0f || o != 0.0f || p != 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
//To be accessed by GL API directly, accessed by pointer.
|
||||||
|
//operator* overloading is way too dangerous, especially in ptr != NULL
|
||||||
|
//tests.
|
||||||
|
inline float* to_ptr() const { return (__float *)this; }
|
||||||
|
|
||||||
operator __float*() const { return (__float *)this; }
|
|
||||||
mat4(__float ai,__float bi,__float ci,__float di,__float ei,__float fi,__float gi,__float hi,__float ii,__float ji,__float ki,__float li,__float mi,__float ni,__float oi,__float pi) {
|
mat4(__float ai,__float bi,__float ci,__float di,__float ei,__float fi,__float gi,__float hi,__float ii,__float ji,__float ki,__float li,__float mi,__float ni,__float oi,__float pi) {
|
||||||
a = ai; b = bi; c = ci; d = di; e = ei; f = fi; g = gi; h = hi; i = ii; j = ji; k = ki; l = li; m = mi; n = ni; o = oi; p = pi;
|
a = ai; b = bi; c = ci; d = di; e = ei; f = fi; g = gi; h = hi; i = ii; j = ji; k = ki; l = li; m = mi; n = ni; o = oi; p = pi;
|
||||||
}
|
}
|
||||||
@ -263,15 +286,15 @@ namespace CubicVR {
|
|||||||
static mat4 transform(vec3 position, vec3 rotation, vec3 scale) {
|
static mat4 transform(vec3 position, vec3 rotation, vec3 scale) {
|
||||||
mat4 m = mat4::identity();
|
mat4 m = mat4::identity();
|
||||||
|
|
||||||
if (position!=NULL) {
|
if (!position) {
|
||||||
m *= mat4::translate(position[0],position[1],position[2]);
|
m *= mat4::translate(position[0],position[1],position[2]);
|
||||||
}
|
}
|
||||||
if (rotation!=NULL) {
|
if (!rotation) {
|
||||||
if (!(rotation[0] == 0 && rotation[1] == 0 && rotation[2] == 0)) {
|
if (!(rotation[0] == 0 && rotation[1] == 0 && rotation[2] == 0)) {
|
||||||
m *= mat4::rotate(rotation[0],rotation[1],rotation[2]);
|
m *= mat4::rotate(rotation[0],rotation[1],rotation[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scale!=NULL) {
|
if (!scale) {
|
||||||
if (!(scale[0] == 1 && scale[1] == 1 && scale[2] == 1)) {
|
if (!(scale[0] == 1 && scale[1] == 1 && scale[2] == 1)) {
|
||||||
m *= mat4::scale(scale[0],scale[1],scale[2]);
|
m *= mat4::scale(scale[0],scale[1],scale[2]);
|
||||||
}
|
}
|
||||||
|
4
external/cubicvr2/math/transform.h
vendored
4
external/cubicvr2/math/transform.h
vendored
@ -88,10 +88,10 @@ namespace CubicVR {
|
|||||||
m_cache.clear();
|
m_cache.clear();
|
||||||
c_stack = 0;
|
c_stack = 0;
|
||||||
valid = 0;
|
valid = 0;
|
||||||
delete result;
|
|
||||||
result = mat4::identity();
|
result = mat4::identity();
|
||||||
|
|
||||||
if (init_mat != NULL) {
|
if (!init_mat) {
|
||||||
m_stack[0] = init_mat;
|
m_stack[0] = init_mat;
|
||||||
} else {
|
} else {
|
||||||
setIdentity();
|
setIdentity();
|
||||||
|
20
external/cubicvr2/math/vec2.h
vendored
20
external/cubicvr2/math/vec2.h
vendored
@ -12,6 +12,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "cubic_types.h"
|
#include "cubic_types.h"
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
namespace CubicVR {
|
namespace CubicVR {
|
||||||
#define vec2SG(c,x,y) \
|
#define vec2SG(c,x,y) \
|
||||||
@ -20,20 +21,27 @@ namespace CubicVR {
|
|||||||
|
|
||||||
struct vec2 {
|
struct vec2 {
|
||||||
__float x, y;
|
__float x, y;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__float& u() { return x; }
|
__float& u() { return x; }
|
||||||
__float& v() { return y; }
|
__float& v() { return y; }
|
||||||
|
|
||||||
// __float operator [] (unsigned i) const { return ((__float *)this)[i]; }
|
//access as-array:
|
||||||
#ifndef _WIN32
|
inline __float& operator [] (size_t i) {
|
||||||
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
|
__float* as_array = (__float*)this;
|
||||||
#endif
|
return (as_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const __float& operator [] (size_t i) const {
|
||||||
|
__float* as_array = (__float*)this;
|
||||||
|
return (as_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
vec2 (__float xi,__float yi) { x = xi; y = yi; }
|
vec2 (__float xi,__float yi) { x = xi; y = yi; }
|
||||||
vec2 () { x = y = 0.0f; }
|
vec2 () { x = y = 0.0f; }
|
||||||
|
|
||||||
operator __float*() const { return (__float *)this; }
|
|
||||||
|
|
||||||
vec2 operator*(__float v) { return vec2( x*v, y*v ); }
|
vec2 operator*(__float v) { return vec2( x*v, y*v ); }
|
||||||
|
|
||||||
// vec2 operator*(vec2 v) { return vec2::cross(*this,v); }
|
// vec2 operator*(vec2 v) { return vec2::cross(*this,v); }
|
||||||
vec2 operator+(vec2 v) { return vec2::add(*this,v); }
|
vec2 operator+(vec2 v) { return vec2::add(*this,v); }
|
||||||
vec2 operator-(vec2 v) { return vec2::subtract(*this,v); }
|
vec2 operator-(vec2 v) { return vec2::subtract(*this,v); }
|
||||||
|
24
external/cubicvr2/math/vec3.h
vendored
24
external/cubicvr2/math/vec3.h
vendored
@ -12,6 +12,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "cubic_types.h"
|
#include "cubic_types.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
namespace CubicVR {
|
namespace CubicVR {
|
||||||
|
|
||||||
@ -23,19 +24,30 @@ namespace CubicVR {
|
|||||||
struct vec3 {
|
struct vec3 {
|
||||||
__float x,y,z;
|
__float x,y,z;
|
||||||
|
|
||||||
operator __float*() const { return (__float *)this; }
|
|
||||||
|
|
||||||
__float& r() { return x; }
|
__float& r() { return x; }
|
||||||
__float& g() { return y; }
|
__float& g() { return y; }
|
||||||
__float& b() { return z; }
|
__float& b() { return z; }
|
||||||
|
|
||||||
#ifndef _WIN32
|
//access as-array:
|
||||||
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
|
inline __float& operator [] (size_t i) {
|
||||||
#endif
|
__float* as_array = (__float*)this;
|
||||||
|
return (as_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const __float& operator [] (size_t i) const {
|
||||||
|
__float* as_array = (__float*)this;
|
||||||
|
return (as_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//compare to ZERO-filled vector
|
||||||
|
inline operator bool() const {
|
||||||
|
|
||||||
|
return (x != 0.0f || y != 0.0f || z != 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
vec3 (__float xi,__float yi,__float zi) { x = xi; y = yi; z = zi; }
|
vec3 (__float xi,__float yi,__float zi) { x = xi; y = yi; z = zi; }
|
||||||
vec3 () { x = y = z = 0.0f; }
|
vec3 () { x = y = z = 0.0f; }
|
||||||
|
|
||||||
|
|
||||||
vec3 operator*(__float v) { return vec3(x*v, y*v, z*v); }
|
vec3 operator*(__float v) { return vec3(x*v, y*v, z*v); }
|
||||||
vec3 operator*(vec3 v) { return vec3::cross(*this,v); }
|
vec3 operator*(vec3 v) { return vec3::cross(*this,v); }
|
||||||
vec3 operator+(vec3 v) { return vec3::add(*this,v); }
|
vec3 operator+(vec3 v) { return vec3::add(*this,v); }
|
||||||
|
21
external/cubicvr2/math/vec4.h
vendored
21
external/cubicvr2/math/vec4.h
vendored
@ -12,6 +12,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "cubic_types.h"
|
#include "cubic_types.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
namespace CubicVR {
|
namespace CubicVR {
|
||||||
|
|
||||||
@ -20,23 +21,29 @@ namespace CubicVR {
|
|||||||
c & COMBINE(set,x)(vec3 value) { y = value; return *this; }
|
c & COMBINE(set,x)(vec3 value) { y = value; return *this; }
|
||||||
|
|
||||||
struct vec4 {
|
struct vec4 {
|
||||||
__float x,y,z,w;
|
|
||||||
|
__float x, y, z, w;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__float& r() { return x; }
|
__float& r() { return x; }
|
||||||
__float& g() { return y; }
|
__float& g() { return y; }
|
||||||
__float& b() { return z; }
|
__float& b() { return z; }
|
||||||
__float& a() { return w; }
|
__float& a() { return w; }
|
||||||
|
|
||||||
// __float operator [] (unsigned i) const { return ((__float *)this)[i]; }
|
//access as-array:
|
||||||
#ifndef _WIN32
|
inline __float& operator [] (size_t i) {
|
||||||
__float& operator [] (unsigned i) { return ((__float *)this)[i]; }
|
__float* as_array = (__float*)this;
|
||||||
#endif
|
return (as_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const __float& operator [] (size_t i) const {
|
||||||
|
__float* as_array = (__float*)this;
|
||||||
|
return (as_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
vec4 (__float xi,__float yi,__float zi,__float wi) { x = xi; y = yi; z = zi; w = wi; }
|
vec4 (__float xi,__float yi,__float zi,__float wi) { x = xi; y = yi; z = zi; w = wi; }
|
||||||
vec4 () { x = y = z = w = 0.0f; }
|
vec4 () { x = y = z = w = 0.0f; }
|
||||||
|
|
||||||
operator __float*() const { return (__float *)this; }
|
|
||||||
|
|
||||||
vec4 operator*(__float v) { return vec4(x*v, y*v, z*v, w*v); }
|
vec4 operator*(__float v) { return vec4(x*v, y*v, z*v, w*v); }
|
||||||
// vec4 operator*(vec4 v) { return vec4::cross(*this,v); }
|
// vec4 operator*(vec4 v) { return vec4::cross(*this,v); }
|
||||||
// vec4 operator+(vec4 v) { return vec4::add(*this,v); }
|
// vec4 operator+(vec4 v) { return vec4::add(*this,v); }
|
||||||
|
@ -35,7 +35,7 @@ void ScopePanel::drawPanelContents() {
|
|||||||
bgPanel.draw();
|
bgPanel.draw();
|
||||||
glLineWidth(1.0);
|
glLineWidth(1.0);
|
||||||
glEnable(GL_LINE_SMOOTH);
|
glEnable(GL_LINE_SMOOTH);
|
||||||
glLoadMatrixf(transform);
|
glLoadMatrixf(transform.to_ptr());
|
||||||
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r * 0.35, ThemeMgr::mgr.currentTheme->scopeLine.g * 0.35,
|
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r * 0.35, ThemeMgr::mgr.currentTheme->scopeLine.g * 0.35,
|
||||||
ThemeMgr::mgr.currentTheme->scopeLine.b * 0.35);
|
ThemeMgr::mgr.currentTheme->scopeLine.b * 0.35);
|
||||||
glBegin (GL_LINES);
|
glBegin (GL_LINES);
|
||||||
@ -52,7 +52,7 @@ void ScopePanel::drawPanelContents() {
|
|||||||
bgPanelStereo[1].draw();
|
bgPanelStereo[1].draw();
|
||||||
|
|
||||||
glLineWidth(1.0);
|
glLineWidth(1.0);
|
||||||
glLoadMatrixf(transform);
|
glLoadMatrixf(transform.to_ptr());
|
||||||
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r, ThemeMgr::mgr.currentTheme->scopeLine.g, ThemeMgr::mgr.currentTheme->scopeLine.b);
|
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r, ThemeMgr::mgr.currentTheme->scopeLine.g, ThemeMgr::mgr.currentTheme->scopeLine.b);
|
||||||
glEnable(GL_LINE_SMOOTH);
|
glEnable(GL_LINE_SMOOTH);
|
||||||
glBegin (GL_LINES);
|
glBegin (GL_LINES);
|
||||||
@ -76,7 +76,7 @@ void ScopePanel::drawPanelContents() {
|
|||||||
glLineWidth(1.0);
|
glLineWidth(1.0);
|
||||||
glEnable(GL_POINT_SMOOTH);
|
glEnable(GL_POINT_SMOOTH);
|
||||||
glPointSize(1.0);
|
glPointSize(1.0);
|
||||||
glLoadMatrixf(transform);
|
glLoadMatrixf(transform.to_ptr());
|
||||||
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r * 0.15, ThemeMgr::mgr.currentTheme->scopeLine.g * 0.15,
|
glColor3f(ThemeMgr::mgr.currentTheme->scopeLine.r * 0.15, ThemeMgr::mgr.currentTheme->scopeLine.g * 0.15,
|
||||||
ThemeMgr::mgr.currentTheme->scopeLine.b * 0.15);
|
ThemeMgr::mgr.currentTheme->scopeLine.b * 0.15);
|
||||||
}
|
}
|
||||||
@ -95,16 +95,16 @@ void ScopePanel::drawPanelContents() {
|
|||||||
glVertexPointer(2, GL_FLOAT, 0, &points[0]);
|
glVertexPointer(2, GL_FLOAT, 0, &points[0]);
|
||||||
glLineWidth(1.5);
|
glLineWidth(1.5);
|
||||||
if (scopeMode == SCOPE_MODE_Y) {
|
if (scopeMode == SCOPE_MODE_Y) {
|
||||||
glLoadMatrixf(bgPanel.transform);
|
glLoadMatrixf(bgPanel.transform.to_ptr());
|
||||||
glDrawArrays(GL_LINE_STRIP, 0, points.size() / 2);
|
glDrawArrays(GL_LINE_STRIP, 0, points.size() / 2);
|
||||||
} else if (scopeMode == SCOPE_MODE_2Y) {
|
} else if (scopeMode == SCOPE_MODE_2Y) {
|
||||||
glLoadMatrixf(bgPanelStereo[0].transform);
|
glLoadMatrixf(bgPanelStereo[0].transform.to_ptr());
|
||||||
glDrawArrays(GL_LINE_STRIP, 0, points.size() / 4);
|
glDrawArrays(GL_LINE_STRIP, 0, points.size() / 4);
|
||||||
|
|
||||||
glLoadMatrixf(bgPanelStereo[1].transform);
|
glLoadMatrixf(bgPanelStereo[1].transform.to_ptr());
|
||||||
glDrawArrays(GL_LINE_STRIP, points.size() / 4, points.size() / 4);
|
glDrawArrays(GL_LINE_STRIP, points.size() / 4, points.size() / 4);
|
||||||
} else if (scopeMode == SCOPE_MODE_XY) {
|
} else if (scopeMode == SCOPE_MODE_XY) {
|
||||||
glLoadMatrixf(bgPanel.transform);
|
glLoadMatrixf(bgPanel.transform.to_ptr());
|
||||||
glDrawArrays(GL_POINTS, 0, points.size() / 2);
|
glDrawArrays(GL_POINTS, 0, points.size() / 2);
|
||||||
}
|
}
|
||||||
glLineWidth(1.0);
|
glLineWidth(1.0);
|
||||||
|
@ -113,7 +113,7 @@ void SpectrumPanel::drawPanelContents() {
|
|||||||
glEnable(GL_LINE_SMOOTH);
|
glEnable(GL_LINE_SMOOTH);
|
||||||
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
|
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
|
||||||
|
|
||||||
glLoadMatrixf(transform * (CubicVR::mat4::translate(-1.0f, -0.75f, 0.0f) * CubicVR::mat4::scale(2.0f, 1.5f, 1.0f)));
|
glLoadMatrixf((transform * (CubicVR::mat4::translate(-1.0f, -0.75f, 0.0f) * CubicVR::mat4::scale(2.0f, 1.5f, 1.0f))).to_ptr());
|
||||||
|
|
||||||
if (points.size()) {
|
if (points.size()) {
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||||
@ -166,7 +166,7 @@ void SpectrumPanel::drawPanelContents() {
|
|||||||
|
|
||||||
float viewHeight = (float) vp[3];
|
float viewHeight = (float) vp[3];
|
||||||
float viewWidth = (float) vp[2];
|
float viewWidth = (float) vp[2];
|
||||||
glLoadMatrixf(transform);
|
glLoadMatrixf(transform.to_ptr());
|
||||||
|
|
||||||
|
|
||||||
long long leftFreq = (double) freq - ((double) bandwidth / 2.0);
|
long long leftFreq = (double) freq - ((double) bandwidth / 2.0);
|
||||||
|
@ -165,7 +165,7 @@ void WaterfallPanel::drawPanelContents() {
|
|||||||
|
|
||||||
int half_fft_size = fft_size / 2;
|
int half_fft_size = fft_size / 2;
|
||||||
|
|
||||||
glLoadMatrixf(transform);
|
glLoadMatrixf(transform.to_ptr());
|
||||||
|
|
||||||
glEnable (GL_TEXTURE_2D);
|
glEnable (GL_TEXTURE_2D);
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
|
||||||
|
@ -308,7 +308,7 @@ void GLPanel::calcTransform(mat4 transform_in) {
|
|||||||
void GLPanel::draw() {
|
void GLPanel::draw() {
|
||||||
float min = -1.0, max = 1.0;
|
float min = -1.0, max = 1.0;
|
||||||
|
|
||||||
glLoadMatrixf(transform);
|
glLoadMatrixf(transform.to_ptr());
|
||||||
|
|
||||||
if (fillType != GLPANEL_FILL_NONE && visible) {
|
if (fillType != GLPANEL_FILL_NONE && visible) {
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
@ -378,7 +378,7 @@ void GLPanel::draw() {
|
|||||||
}
|
}
|
||||||
// if (coord == GLPANEL_Y_UP) {
|
// if (coord == GLPANEL_Y_UP) {
|
||||||
// }
|
// }
|
||||||
glLoadMatrixf(transform * mCoord);
|
glLoadMatrixf((transform * mCoord).to_ptr());
|
||||||
drawPanelContents();
|
drawPanelContents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
|||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
glLoadMatrixf(CubicVR::mat4::perspective(45.0, 1.0, 1.0, 1000.0));
|
glLoadMatrixf(CubicVR::mat4::perspective(45.0, 1.0, 1.0, 1000.0).to_ptr());
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
|||||||
spectrumPanel.drawChildren();
|
spectrumPanel.drawChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
glLoadMatrixf(scopePanel.transform);
|
glLoadMatrixf(scopePanel.transform.to_ptr());
|
||||||
if (!deviceName.empty()) {
|
if (!deviceName.empty()) {
|
||||||
glContext->DrawDeviceName(deviceName);
|
glContext->DrawDeviceName(deviceName);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user