#ifndef InterfaceGraphic_AspectHeader
#define InterfaceGraphic_AspectHeader
-#ifndef IMP100701
-#define IMP100701 /* GG Add depth field in the bitmap structure */
-#endif
-
-#ifndef RIC120302
-#define RIC120302 /*GG Add NEW field in CALL_DEF_WINDOW structure
-// to registred parent window ID
-// Change Aspect_Handle to Aspect_Drawable for
-// a more correct understanding.
-*/
-#endif
-
#include <Aspect_Drawable.hxx>
#include <Aspect_RenderingContext.hxx>
int IsDefined;
Aspect_Drawable XWindow;
-
-#ifdef RIC120302
Aspect_Drawable XParentWindow;
-#endif
EXT_WINDOW *ext_data;
float xm, ym, xM, yM;
} Position;
- float dx, dy;
+ int dx, dy;
char *Title;
aContext->ApplyProjectionMatrix();
if (!ACLayer.sizeDependent)
- glViewport (0, 0, dispWidth, dispHeight);
+ aContext->core11fwd->glViewport (0, 0, dispWidth, dispHeight);
float left = ACLayer.ortho[0];
float right = ACLayer.ortho[1];
int attach = ACLayer.attach;
- float ratio;
- if (!ACLayer.sizeDependent)
- ratio = (float) dispWidth/dispHeight;
- else
- ratio = ACView.DefWindow.dx/ACView.DefWindow.dy;
+ const float ratio = !ACLayer.sizeDependent
+ ? float(dispWidth) / float(dispHeight)
+ : float(theWorkspace->Width()) / float(theWorkspace->Height());
float delta;
if (ratio >= 1.0) {
GLsizei anViewportY = 0;
thePrintContext->GetLayerViewport (anViewportX, anViewportY);
if (anViewportX != 0 && anViewportY != 0)
- glViewport (0, 0, anViewportX, anViewportY);
+ aContext->core11fwd->glViewport (0, 0, anViewportX, anViewportY);
}
#endif
aContext->ApplyWorldViewMatrix();
if (!ACLayer.sizeDependent)
- glViewport (0, 0, (GLsizei) ACView.DefWindow.dx, (GLsizei) ACView.DefWindow.dy);
+ aContext->core11fwd->glViewport (0, 0, theWorkspace->Width(), theWorkspace->Height());
glFlush ();
#endif
const Handle(OpenGl_Context)& theShareCtx)
: myGlContext (new OpenGl_Context (theCaps)),
myOwnGContext (theGContext == 0),
- myWidth ((Standard_Integer )theCWindow.dx),
- myHeight ((Standard_Integer )theCWindow.dy),
+ myWidth (theCWindow.dx),
+ myHeight (theCWindow.dy),
myBgColor (THE_DEFAULT_BG_COLOR)
{
myBgColor.rgb[0] = theCWindow.Background.r;
if ((myWidth == theCWindow.dx) && (myHeight == theCWindow.dy))
return;
- myWidth = (Standard_Integer )theCWindow.dx;
- myHeight = (Standard_Integer )theCWindow.dy;
+ myWidth = theCWindow.dx;
+ myHeight = theCWindow.dy;
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__)
XResizeWindow (aDisp, myGlContext->myWindow, (unsigned int )myWidth, (unsigned int )myHeight);
return;
#if defined(HAVE_EGL) || defined(__ANDROID__)
- eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_WIDTH, &myWidth);
- eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight);
+ eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_WIDTH, &myWidth);
+ eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight);
#elif defined(_WIN32)
RECT cr;
GetClientRect ((HWND )myGlContext->myWindow, &cr);
#endif
glDisable (GL_SCISSOR_TEST);
+ glViewport (0, 0, myWidth, myHeight);
#if !defined(GL_ES_VERSION_2_0)
glMatrixMode (GL_MODELVIEW);
- glViewport (0, 0, myWidth, myHeight);
glDrawBuffer (GL_BACK);
#endif
}
aGlCtx->FetchState();
Tint toSwap = (aGlCtx->IsRender() && !aGlCtx->caps->buffersNoSwap) ? 1 : 0; // swap buffers
- GLint aViewPortBack[4];
OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer* )theCView.ptrFBO;
if (aFrameBuffer != NULL)
{
- glGetIntegerv (GL_VIEWPORT, aViewPortBack);
aFrameBuffer->SetupViewport (aGlCtx);
toSwap = 0; // no need to swap buffers
}
+ else
+ {
+ aGlCtx->core11fwd->glViewport (0, 0, myWidth, myHeight);
+ }
myToRedrawGL = Standard_True;
if (theCView.RenderParams.Method == Graphic3d_RM_RAYTRACING
{
aFrameBuffer->UnbindBuffer (aGlCtx);
// move back original viewport
- glViewport (aViewPortBack[0], aViewPortBack[1], aViewPortBack[2], aViewPortBack[3]);
+ aGlCtx->core11fwd->glViewport (0, 0, myWidth, myHeight);
}
#if defined(_WIN32) && defined(HAVE_VIDEOCAPTURE)
Standard_Integer Width, Height;
theWindow->Size (Width, Height);
- MyCView.DefWindow.dx = float(Width);
- MyCView.DefWindow.dy = float(Height);
+ MyCView.DefWindow.dx = Width;
+ MyCView.DefWindow.dy = Height;
Standard_Real R, G, B;
MyBackground = MyWindow->Background ();
MyWindow->Size (aWidth, aHeight);
if (aWidth > 0 && aHeight > 0)
{
- Standard_Real aRatio = (Standard_Real)aWidth / (Standard_Real)aHeight;
+ Standard_Real aRatio = (Standard_Real)aWidth / (Standard_Real)aHeight;
- MyCView.DefWindow.dx = Standard_ShortReal (aWidth);
- MyCView.DefWindow.dy = Standard_ShortReal (aHeight);
+ MyCView.DefWindow.dx = aWidth;
+ MyCView.DefWindow.dy = aHeight;
myGraphicDriver->RatioWindow (MyCView);