From ed80637dad3760b07f4e3f39c523823d3552838b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 4 Sep 2017 06:20:12 +0000 Subject: [PATCH] EgtGraphics 1.8i1 : - aggiornamenti per GLEW 2.1.0. --- EgtGraphics.rc | Bin 11604 -> 11604 bytes ObjNewGraphics.cpp | 2 +- OpenGL.h | 1 - Scene.h | 14 ++++---------- SceneBasic.cpp | 11 +++++------ stdafx.h | 4 ++-- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/EgtGraphics.rc b/EgtGraphics.rc index 87e7ef6b3ebe3380dcf92e6bce9f1b7099f33db3..5669e1698331a0a29b7544a665b89212fbf343e5 100644 GIT binary patch delta 127 zcmcZ-btP)UH#SyF1|0^&%?J7RGfm>rnVhGn!ko!qIQgKo?&d#|K8%~&xXqa1YP6Z* Xk}^UKEZD^VNH!tFahS=c?8XHE(K03N delta 127 zcmcZ-btP)UH#Sxa1|0^Y%?J7RGfm>rnVhGn!kociH2I*k?&d#|K8%~&xXqa1YP6Z* Xk}^UKEZD^VNH!tFahS=c?8XHE(HbS~ diff --git a/ObjNewGraphics.cpp b/ObjNewGraphics.cpp index 8339840..dfe357d 100644 --- a/ObjNewGraphics.cpp +++ b/ObjNewGraphics.cpp @@ -23,7 +23,7 @@ //--------------------------- Macro e Costanti ------------------------------- // Per funzioni glew dipendenti dal context -#define glewGetContext() (( m_pScene != nullptr) ? m_pScene->glewGetContext() : nullptr) +//#define glewGetContext() (( m_pScene != nullptr) ? m_pScene->glewGetContext() : nullptr) // Dimensioni flag per edge di triangoli const size_t SIZEFLAG = sizeof( unsigned char) ; // Dimensioni record del buffer ( vertice + normale + flag) diff --git a/OpenGL.h b/OpenGL.h index 2e40e7b..28e9b14 100644 --- a/OpenGL.h +++ b/OpenGL.h @@ -13,7 +13,6 @@ #pragma once -#define GLEW_MX #define NOMINMAX #include "/EgtDev/Extern/GLEW/Include/glew.h" #include "/EgtDev/Extern/GLEW/Include/wglew.h" diff --git a/Scene.h b/Scene.h index 05156db..e93cc93 100644 --- a/Scene.h +++ b/Scene.h @@ -188,8 +188,6 @@ class Scene : public IEGrScene // Basic Scene( void) ; bool MakeCurrent( void) const ; - GLEWContext* glewGetContext( void) - { return &m_glewc ; } int GetOpenGLver( void) { return m_nOglVer ; } // Geometry @@ -201,8 +199,6 @@ class Scene : public IEGrScene private : // Basic int ChooseGenPixelFormat( int nPfd, bool b2Buff, int nColorBits, int nDepthBits) ; - WGLEWContext* wglewGetContext( void) - { return &m_wglewc ; } bool CalcExtView( void) ; bool CalcDimViewFromExtView( void) ; bool AdjustDimView( double dHalfWidth, double dHalfHeight) ; @@ -253,12 +249,10 @@ class Scene : public IEGrScene private : // Basic - HDC m_hDC ; // Device Context - HGLRC m_hRC ; // OpenGL Rendering Context - WGLEWContext m_wglewc ; // WGLEW Context - GLEWContext m_glewc ; // GLEW Context - int m_nOglVer ; // OpenGL Version - bool m_bNewWay ; // flag che indica nuova modalità (OpenGL 3.0 in poi) + HDC m_hDC ; // Device Context + HGLRC m_hRC ; // OpenGL Rendering Context + int m_nOglVer ; // OpenGL Version + bool m_bNewWay ; // flag che indica nuova modalità (OpenGL 3.0 in poi) // Camera Point3d m_ptCenter ; // centro verso cui è rivolta la camera Vector3d m_vtDirCamera ; // versore direzione dal centro alla camera diff --git a/SceneBasic.cpp b/SceneBasic.cpp index e776f0e..8b97ac9 100644 --- a/SceneBasic.cpp +++ b/SceneBasic.cpp @@ -50,8 +50,6 @@ Scene::Scene( void) // Context data m_hDC = nullptr ; m_hRC = nullptr ; - memset( &m_wglewc, 0, sizeof( WGLEWContext)) ; - memset( &m_glewc, 0, sizeof( GLEWContext)) ; m_nOglVer = 0 ; m_bNewWay = false ; // Camera e viewport @@ -279,12 +277,13 @@ Scene::MakeCurrent( void) const if ( m_hRC == nullptr) return false ; - // se RC della scena non è quello corrente, lo imposto + // se RC della scena è quello corrente, ok HGLRC hRC = wglGetCurrentContext() ; - if ( m_hRC != hRC) - return ( wglMakeCurrent( m_hDC, m_hRC) != 0) ; + if ( m_hRC == hRC) + return true ; - return true ; + // impost RC della scena + return ( wglMakeCurrent( m_hDC, m_hRC) != 0) ; } //---------------------------------------------------------------------------- diff --git a/stdafx.h b/stdafx.h index 082ddd6..c8f542b 100644 --- a/stdafx.h +++ b/stdafx.h @@ -31,10 +31,10 @@ #pragma comment(lib, "opengl32.lib") #pragma comment(lib, "glu32.lib") #if defined( _WIN64) -#pragma comment(lib, EGTEXTDIR "GLEW/lib/x64/glew32mx.lib") +#pragma comment(lib, EGTEXTDIR "GLEW/lib/x64/glew32.lib") #pragma comment(lib, EGTEXTDIR "FreeImage/lib/x64/FreeImage.lib") #elif defined( _WIN32) -#pragma comment(lib, EGTEXTDIR "GLEW/lib/x32/glew32mx.lib") +#pragma comment(lib, EGTEXTDIR "GLEW/lib/x32/glew32.lib") #pragma comment(lib, EGTEXTDIR "FreeImage/lib/x32/FreeImage.lib") #endif