#include <Font_FontAspect.hxx>
-#include <OpenGl_Display.hxx>
#include <OpenGl_AspectText.hxx>
#include <OpenGl_Text.hxx>
#include <OpenGl_TextParam.hxx>
+#include <OpenGl_LineAttributes.hxx>
/*----------------------------------------------------------------------*/
glDisable (GL_BLEND);
}
-void OpenGl_GraphicDriver::SetLineAttributes (const Standard_Integer Type, const Standard_ShortReal Width)
+void OpenGl_GraphicDriver::SetLineAttributes (const Standard_Integer theType,
+ const Standard_ShortReal theWidth)
{
- if (!TheLayerProp.ListId || myGlDisplay.IsNull()) return;
+ const Handle(OpenGl_Context)& aCtx = GetSharedContext();
+ if (!TheLayerProp.ListId
+ || aCtx.IsNull())
+ {
+ return;
+ }
- if (TheLayerProp.LineType != Type)
+ if (TheLayerProp.LineType != theType)
{
- TheLayerProp.LineType = Type;
- myGlDisplay->SetTypeOfLine((Aspect_TypeOfLine) Type);
+ Handle(OpenGl_LineAttributes) aLineAttribs;
+ if (aCtx->GetResource ("OpenGl_LineAttributes", aLineAttribs))
+ {
+ TheLayerProp.LineType = theType;
+ aLineAttribs->SetTypeOfLine ((Aspect_TypeOfLine )theType);
+ }
}
- if (TheLayerProp.LineWidth != Width)
+ if (TheLayerProp.LineWidth != theWidth)
{
- TheLayerProp.LineWidth = Width;
- glLineWidth ((GLfloat) Width);
+ TheLayerProp.LineWidth = theWidth;
+ glLineWidth ((GLfloat )theWidth);
}
}