Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
c42e69ad3d
3 changed files with 19 additions and 15 deletions
  1. +4
    -4
      src/juce_appframework/gui/components/special/juce_OpenGLComponent.cpp
  2. +5
    -5
      src/juce_appframework/gui/components/special/juce_OpenGLComponent.h
  3. +10
    -6
      src/juce_appframework/gui/graphics/contexts/juce_Graphics.cpp

+ 4
- 4
src/juce_appframework/gui/components/special/juce_OpenGLComponent.cpp View File

@@ -139,10 +139,10 @@ void OpenGLComponent::createContext()
if (context == 0 && isShowing() && getTopLevelComponent()->getPeer() != 0)
{
context = OpenGLContext::createContextForWindow (this,
preferredPixelFormat,
componentToShareListsWith != 0
? componentToShareListsWith->context
context = OpenGLContext::createContextForWindow (this,
preferredPixelFormat,
componentToShareListsWith != 0
? componentToShareListsWith->context
: 0);
if (context != 0)


+ 5
- 5
src/juce_appframework/gui/components/special/juce_OpenGLComponent.h View File

@@ -51,7 +51,7 @@ struct OpenGLPixelFormat
//==============================================================================
/** Creates an OpenGLPixelFormat.
The default constructor just initialises the object as a simple 8-bit
The default constructor just initialises the object as a simple 8-bit
RGBA format.
*/
OpenGLPixelFormat (const int bitsPerRGBComponent = 8,
@@ -140,7 +140,7 @@ public:
you're doing - the OpenGLComponent calls this and manages the context for you.
*/
static OpenGLContext* createContextForWindow (Component* componentToDrawTo,
const OpenGLPixelFormat& pixelFormat,
const OpenGLPixelFormat& pixelFormat,
const OpenGLContext* const contextToShareWith);
//==============================================================================
@@ -218,7 +218,7 @@ public:
/** Returns the context that will draw into this component.
This may return 0 if it failed to initialise properly, or if the component
is currently invisible. The context object may be deleted and a new one created
is currently invisible. The context object may be deleted and a new one created
during the life of this component - see newOpenGLContextCreated().
*/
OpenGLContext* getCurrentContext() const throw();
@@ -255,8 +255,8 @@ public:
/** Calls the rendering callback, and swaps the buffers afterwards.
This is called automatically by paint() when the component needs to be rendered.
It can be overridden if you need to decouple the rendering from the paint callback
It can be overridden if you need to decouple the rendering from the paint callback
and render with a custom thread.
Returns true if the operation succeeded.


+ 10
- 6
src/juce_appframework/gui/graphics/contexts/juce_Graphics.cpp View File

@@ -458,8 +458,8 @@ void Graphics::drawRect (const int x,
void Graphics::drawRect (const Rectangle& r,
const int lineThickness) const throw()
{
drawRect (r.getX(), r.getY(),
r.getWidth(), r.getHeight(),
drawRect (r.getX(), r.getY(),
r.getWidth(), r.getHeight(),
lineThickness);
}
@@ -538,8 +538,10 @@ void Graphics::fillRoundedRectangle (const float x,
void Graphics::fillRoundedRectangle (const Rectangle& r,
const float cornerSize) const throw()
{
fillRoundedRectangle (r.getX(), r.getY(),
r.getWidth(), r.getHeight(),
fillRoundedRectangle ((float) r.getX(),
(float) r.getY(),
(float) r.getWidth(),
(float) r.getHeight(),
cornerSize);
}
@@ -562,8 +564,10 @@ void Graphics::drawRoundedRectangle (const Rectangle& r,
const float cornerSize,
const float lineThickness) const throw()
{
drawRoundedRectangle (r.getX(), r.getY(),
r.getWidth(), r.getHeight(),
drawRoundedRectangle ((float) r.getX(),
(float) r.getY(),
(float) r.getWidth(),
(float) r.getHeight(),
cornerSize, lineThickness);
}


Loading…
Cancel
Save