Browse Source

Tidied up some docs and comments.

tags/2021-05-28
jules 13 years ago
parent
commit
351416c09a
9 changed files with 12 additions and 13 deletions
  1. +2
    -3
      extras/JuceDemo/Source/demos/OpenGLDemo.cpp
  2. +2
    -2
      modules/juce_core/maths/juce_MathsFunctions.h
  3. +1
    -1
      modules/juce_core/memory/juce_Memory.h
  4. +1
    -1
      modules/juce_events/native/juce_linux_Messaging.cpp
  5. +1
    -1
      modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.h
  6. +1
    -1
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp
  7. +1
    -1
      modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp
  8. +2
    -2
      modules/juce_opengl/opengl/juce_OpenGLPixelFormat.h
  9. +1
    -1
      modules/juce_opengl/opengl/juce_OpenGLTexture.cpp

+ 2
- 3
extras/JuceDemo/Source/demos/OpenGLDemo.cpp View File

@@ -37,9 +37,8 @@ public:
: rotation (0.0f), : rotation (0.0f),
textScrollPos (200) textScrollPos (200)
{ {
infoLabel.setText ("These sliders demonstrate how components can be added as children "
"of an OpenGLComponent, in which case, their content will be rendered into "
"an OpenGL framebuffer and efficiently overlaid onto your GL content.", false);
infoLabel.setText ("These sliders demonstrate how components and 2D graphics can be rendered "
"using OpenGL by using the OpenGLContext class.", false);
infoLabel.setInterceptsMouseClicks (false, false); infoLabel.setInterceptsMouseClicks (false, false);
addAndMakeVisible (&infoLabel); addAndMakeVisible (&infoLabel);
infoLabel.setBounds ("parent.width * 0.05, bottom - 150, parent.width * 0.4, parent.height - 60"); infoLabel.setBounds ("parent.width * 0.05, bottom - 150, parent.width * 0.4, parent.height - 60");


+ 2
- 2
modules/juce_core/maths/juce_MathsFunctions.h View File

@@ -430,9 +430,9 @@ bool isPowerOfTwo (IntegerType value)
return (value & (value - 1)) == 0; return (value & (value - 1)) == 0;
} }
/** Returns the next power-of-two which is equal to or greater than the given integer.
/** Returns the smallest power-of-two which is equal to or greater than the given integer.
*/ */
inline int nextPowerOfTwo (int n)
inline int nextPowerOfTwo (int n) noexcept
{ {
--n; --n;
n |= (n >> 1); n |= (n >> 1);


+ 1
- 1
modules/juce_core/memory/juce_Memory.h View File

@@ -57,7 +57,7 @@ inline void zerostruct (Type& structure) noexcept { memset (&s
/** Delete an object pointer, and sets the pointer to null. /** Delete an object pointer, and sets the pointer to null.
Remember that it's not good c++ practice to use delete directly - always try to use a ScopedPointer Remember that it's not good c++ practice to use delete directly - always try to use a ScopedPointer
or other automatic lieftime-management system rather than resorting to deleting raw pointers!
or other automatic lifetime-management system rather than resorting to deleting raw pointers!
*/ */
template <typename Type> template <typename Type>
inline void deleteAndZero (Type& pointer) { delete pointer; pointer = nullptr; } inline void deleteAndZero (Type& pointer) { delete pointer; pointer = nullptr; }


+ 1
- 1
modules/juce_events/native/juce_linux_Messaging.cpp View File

@@ -239,7 +239,7 @@ namespace LinuxErrorHandling
XGetErrorText (display, event->error_code, errorStr, 64); XGetErrorText (display, event->error_code, errorStr, 64);
XGetErrorDatabaseText (display, "XRequest", String (event->request_code).toUTF8(), "Unknown", requestStr, 64); XGetErrorDatabaseText (display, "XRequest", String (event->request_code).toUTF8(), "Unknown", requestStr, 64);
DBG ("ERROR: X returned " + String (errorStr) + " for operation " + String (requestStr));
DBG ("ERROR: X returned " << errorStr << " for operation " << requestStr);
#endif #endif
return 0; return 0;


+ 1
- 1
modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.h View File

@@ -40,7 +40,7 @@
It also includes a callback that lets you know when the top-level peer is changed. It also includes a callback that lets you know when the top-level peer is changed.
This class is used by specialised components like OpenGLComponent or QuickTimeComponent
This class is used by specialised components like WebBrowserComponent or QuickTimeComponent
because they need to keep their custom windows in the right place and respond to because they need to keep their custom windows in the right place and respond to
changes in the peer. changes in the peer.
*/ */


+ 1
- 1
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -165,7 +165,7 @@ public:
needsUpdate = false; needsUpdate = false;
// you mustn't set your own cached image object for an OpenGLComponent!
// you mustn't set your own cached image object when attaching a GL context!
jassert (get (component) == this); jassert (get (component) == this);
const Rectangle<int> bounds (component.getLocalBounds()); const Rectangle<int> bounds (component.getLocalBounds());


+ 1
- 1
modules/juce_opengl/opengl/juce_OpenGLFrameBuffer.cpp View File

@@ -39,7 +39,7 @@ public:
ok (true) ok (true)
{ {
// Framebuffer objects can only be created when the current thread has an active OpenGL // Framebuffer objects can only be created when the current thread has an active OpenGL
// context. You'll need to make an OpenGLComponent active before calling this.
// context. You'll need to create this object in one of the OpenGLContext's callbacks.
jassert (OpenGLHelpers::isContextActive()); jassert (OpenGLHelpers::isContextActive());
#if JUCE_WINDOWS || JUCE_LINUX #if JUCE_WINDOWS || JUCE_LINUX


+ 2
- 2
modules/juce_opengl/opengl/juce_OpenGLPixelFormat.h View File

@@ -29,9 +29,9 @@
//============================================================================== //==============================================================================
/** /**
Represents the various properties of an OpenGL bitmap format.
Represents the various properties of an OpenGL pixel format.
@see OpenGLComponent::setPixelFormat
@see OpenGLContext::setPixelFormat
*/ */
class JUCE_API OpenGLPixelFormat class JUCE_API OpenGLPixelFormat
{ {


+ 1
- 1
modules/juce_opengl/opengl/juce_OpenGLTexture.cpp View File

@@ -41,7 +41,7 @@ bool OpenGLTexture::isValidSize (int width, int height)
void OpenGLTexture::create (const int w, const int h, const void* pixels, GLenum type) void OpenGLTexture::create (const int w, const int h, const void* pixels, GLenum type)
{ {
// Texture objects can only be created when the current thread has an active OpenGL // Texture objects can only be created when the current thread has an active OpenGL
// context. You'll need to make an OpenGLComponent active before calling this.
// context. You'll need to create this object in one of the OpenGLContext's callbacks.
jassert (OpenGLHelpers::isContextActive()); jassert (OpenGLHelpers::isContextActive());
jassert (isValidSize (w, h)); // Perhaps these dimensions must be a power-of-two? jassert (isValidSize (w, h)); // Perhaps these dimensions must be a power-of-two?


Loading…
Cancel
Save