Browse Source

New class: OpenGLFrameBufferImage, which wraps a framebuffer inside a juce Image.

tags/2021-05-28
jules 14 years ago
parent
commit
5a45b4f4c6
18 changed files with 360 additions and 0 deletions
  1. +4
    -0
      extras/JuceDemo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj
  2. +11
    -0
      extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.vcproj
  3. +11
    -0
      extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.vcproj
  4. +4
    -0
      extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj
  5. +6
    -0
      extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj.filters
  6. +4
    -0
      extras/JuceDemo/Builds/iOS/Juce Demo.xcodeproj/project.pbxproj
  7. +4
    -0
      extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj
  8. +11
    -0
      extras/audio plugin host/Builds/VisualStudio2005/Plugin Host.vcproj
  9. +11
    -0
      extras/audio plugin host/Builds/VisualStudio2008/Plugin Host.vcproj
  10. +4
    -0
      extras/static library/Builds/MacOSX/juce.xcodeproj/project.pbxproj
  11. +11
    -0
      extras/static library/Builds/VisualStudio2008/juce.vcproj
  12. +4
    -0
      extras/static library/Builds/VisualStudio2010/juce.vcxproj
  13. +6
    -0
      extras/static library/Builds/VisualStudio2010/juce.vcxproj.filters
  14. +1
    -0
      modules/juce_opengl/juce_opengl.cpp
  15. +3
    -0
      modules/juce_opengl/juce_opengl.h
  16. +2
    -0
      modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp
  17. +193
    -0
      modules/juce_opengl/opengl/juce_OpenGLImage.cpp
  18. +70
    -0
      modules/juce_opengl/opengl/juce_OpenGLImage.h

+ 4
- 0
extras/JuceDemo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj View File

@@ -135,6 +135,7 @@
16793951B75EADE5C08FD129 = { isa = PBXFileReference; lastKnownFileType = file.icns; name = Icon.icns; path = Icon.icns; sourceTree = "SOURCE_ROOT"; };
16A6895439607DD8E651BA87 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ByteOrder.h"; path = "../../../../modules/juce_core/memory/juce_ByteOrder.h"; sourceTree = "SOURCE_ROOT"; };
171777847EB6194910E9CFEC = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_TableHeaderComponent.h"; path = "../../../../modules/juce_gui_basics/widgets/juce_TableHeaderComponent.h"; sourceTree = "SOURCE_ROOT"; };
17422D876DAAF091ED089B8D = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_OpenGLImage.h"; path = "../../../../modules/juce_opengl/opengl/juce_OpenGLImage.h"; sourceTree = "SOURCE_ROOT"; };
1798F0BC1F2B2DF2F13193AB = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_SystemStats.cpp"; path = "../../../../modules/juce_core/system/juce_SystemStats.cpp"; sourceTree = "SOURCE_ROOT"; };
18666AEC1FCCE5D1514EB1FD = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_KeyListener.cpp"; path = "../../../../modules/juce_gui_basics/keyboard/juce_KeyListener.cpp"; sourceTree = "SOURCE_ROOT"; };
18D1181C39F5A59423AC7A3E = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Initialisation.h"; path = "../../../../modules/juce_gui_basics/application/juce_Initialisation.h"; sourceTree = "SOURCE_ROOT"; };
@@ -824,6 +825,7 @@
E38DE271B32DCC95E52C72DA = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_DrawableButton.h"; path = "../../../../modules/juce_gui_basics/buttons/juce_DrawableButton.h"; sourceTree = "SOURCE_ROOT"; };
E3FC888CC9FAD650C469ACC5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_TextButton.cpp"; path = "../../../../modules/juce_gui_basics/buttons/juce_TextButton.cpp"; sourceTree = "SOURCE_ROOT"; };
E453E312D607E60FAA6D1BF0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MultiDocumentPanel.cpp"; path = "../../../../modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp"; sourceTree = "SOURCE_ROOT"; };
E46977801F19277F4D3B324B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_OpenGLImage.cpp"; path = "../../../../modules/juce_opengl/opengl/juce_OpenGLImage.cpp"; sourceTree = "SOURCE_ROOT"; };
E5DC4602843749A071B17576 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Slider.h"; path = "../../../../modules/juce_gui_basics/widgets/juce_Slider.h"; sourceTree = "SOURCE_ROOT"; };
E6B13A51A01032961340735D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_StringPairArray.cpp"; path = "../../../../modules/juce_core/text/juce_StringPairArray.cpp"; sourceTree = "SOURCE_ROOT"; };
E6C582E67DC0C4D0CCA18166 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ShapeButton.h"; path = "../../../../modules/juce_gui_basics/buttons/juce_ShapeButton.h"; sourceTree = "SOURCE_ROOT"; };
@@ -1866,6 +1868,8 @@
43E4604C39E9A992216F6B98,
D7239D5B984E07808E2DB28C,
D2C40CDF46D894BFC72BDC56,
E46977801F19277F4D3B324B,
17422D876DAAF091ED089B8D,
B81FA2ED22BCC03D124031ED,
FE9A5898294228EB7F439951,
4CFB262AA9778621B8B33A7D ); name = opengl; sourceTree = "<group>"; };


+ 11
- 0
extras/JuceDemo/Builds/VisualStudio2005/Juce Demo.vcproj View File

@@ -4230,6 +4230,17 @@
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.cpp">
<FileConfiguration Name="Debug|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration Name="Release|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLPixelFormat.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.cpp">
<FileConfiguration Name="Debug|Win32"


+ 11
- 0
extras/JuceDemo/Builds/VisualStudio2008/Juce Demo.vcproj View File

@@ -4230,6 +4230,17 @@
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.cpp">
<FileConfiguration Name="Debug|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration Name="Release|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLPixelFormat.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.cpp">
<FileConfiguration Name="Debug|Win32"


+ 4
- 0
extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj View File

@@ -1136,6 +1136,9 @@
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@@ -1574,6 +1577,7 @@
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLContext.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLFrameBuffer.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLPixelFormat.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\juce_opengl.h"/>


+ 6
- 0
extras/JuceDemo/Builds/VisualStudio2010/Juce Demo.vcxproj.filters View File

@@ -1492,6 +1492,9 @@
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.cpp">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.cpp">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.cpp">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClCompile>
@@ -2772,6 +2775,9 @@
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.h">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.h">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLPixelFormat.h">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClInclude>


+ 4
- 0
extras/JuceDemo/Builds/iOS/Juce Demo.xcodeproj/project.pbxproj View File

@@ -127,6 +127,7 @@
16793951B75EADE5C08FD129 = { isa = PBXFileReference; lastKnownFileType = file.icns; name = Icon.icns; path = Icon.icns; sourceTree = "SOURCE_ROOT"; };
16A6895439607DD8E651BA87 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ByteOrder.h"; path = "../../../../modules/juce_core/memory/juce_ByteOrder.h"; sourceTree = "SOURCE_ROOT"; };
171777847EB6194910E9CFEC = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_TableHeaderComponent.h"; path = "../../../../modules/juce_gui_basics/widgets/juce_TableHeaderComponent.h"; sourceTree = "SOURCE_ROOT"; };
17422D876DAAF091ED089B8D = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_OpenGLImage.h"; path = "../../../../modules/juce_opengl/opengl/juce_OpenGLImage.h"; sourceTree = "SOURCE_ROOT"; };
1798F0BC1F2B2DF2F13193AB = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_SystemStats.cpp"; path = "../../../../modules/juce_core/system/juce_SystemStats.cpp"; sourceTree = "SOURCE_ROOT"; };
18666AEC1FCCE5D1514EB1FD = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_KeyListener.cpp"; path = "../../../../modules/juce_gui_basics/keyboard/juce_KeyListener.cpp"; sourceTree = "SOURCE_ROOT"; };
18D1181C39F5A59423AC7A3E = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Initialisation.h"; path = "../../../../modules/juce_gui_basics/application/juce_Initialisation.h"; sourceTree = "SOURCE_ROOT"; };
@@ -810,6 +811,7 @@
E3D24CD61D75922457DB9642 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_win32_Midi.cpp"; path = "../../../../modules/juce_audio_devices/native/juce_win32_Midi.cpp"; sourceTree = "SOURCE_ROOT"; };
E3FC888CC9FAD650C469ACC5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_TextButton.cpp"; path = "../../../../modules/juce_gui_basics/buttons/juce_TextButton.cpp"; sourceTree = "SOURCE_ROOT"; };
E453E312D607E60FAA6D1BF0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MultiDocumentPanel.cpp"; path = "../../../../modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp"; sourceTree = "SOURCE_ROOT"; };
E46977801F19277F4D3B324B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_OpenGLImage.cpp"; path = "../../../../modules/juce_opengl/opengl/juce_OpenGLImage.cpp"; sourceTree = "SOURCE_ROOT"; };
E48615F1F7D8213F6DC24FC9 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ThreadPool.h"; path = "../../../../modules/juce_core/threads/juce_ThreadPool.h"; sourceTree = "SOURCE_ROOT"; };
E5DC4602843749A071B17576 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Slider.h"; path = "../../../../modules/juce_gui_basics/widgets/juce_Slider.h"; sourceTree = "SOURCE_ROOT"; };
E6B13A51A01032961340735D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_StringPairArray.cpp"; path = "../../../../modules/juce_core/text/juce_StringPairArray.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -1856,6 +1858,8 @@
43E4604C39E9A992216F6B98,
D7239D5B984E07808E2DB28C,
D2C40CDF46D894BFC72BDC56,
E46977801F19277F4D3B324B,
17422D876DAAF091ED089B8D,
B81FA2ED22BCC03D124031ED,
FE9A5898294228EB7F439951,
4CFB262AA9778621B8B33A7D ); name = opengl; sourceTree = "<group>"; };


+ 4
- 0
extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj View File

@@ -302,6 +302,7 @@
4C3B55EC342AD41B525ABEBE = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_FileOutputStream.h"; path = "../../../../modules/juce_core/files/juce_FileOutputStream.h"; sourceTree = "SOURCE_ROOT"; };
4C46D1CE125E2770BF5D0E36 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_InterprocessConnectionServer.h"; path = "../../../../modules/juce_events/interprocess/juce_InterprocessConnectionServer.h"; sourceTree = "SOURCE_ROOT"; };
4CAFE02422227FB8CDD130A5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_AudioUnitPluginFormat.h"; path = "../../../../modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h"; sourceTree = "SOURCE_ROOT"; };
4CE76ABC51CC5E019AED3C2B = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_OpenGLImage.h"; path = "../../../../modules/juce_opengl/opengl/juce_OpenGLImage.h"; sourceTree = "SOURCE_ROOT"; };
4CEDF2832E38C0B313ED40D5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_AudioProcessorGraph.h"; path = "../../../../modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h"; sourceTree = "SOURCE_ROOT"; };
4D2D008FEC5F93DEFFBE4B56 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ApplicationBase.h"; path = "../../../../modules/juce_events/messages/juce_ApplicationBase.h"; sourceTree = "SOURCE_ROOT"; };
4D664CA1434E85BEA96E6E1B = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Time.h"; path = "../../../../modules/juce_core/time/juce_Time.h"; sourceTree = "SOURCE_ROOT"; };
@@ -646,6 +647,7 @@
C08CEA80C09A398668B42CF9 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Sampler.h"; path = "../../../../modules/juce_audio_formats/sampler/juce_Sampler.h"; sourceTree = "SOURCE_ROOT"; };
C0AB1E87CD628F5534F41588 = { isa = PBXFileReference; lastKnownFileType = file; name = "juce_module_info"; path = "../../../../modules/juce_events/juce_module_info"; sourceTree = "SOURCE_ROOT"; };
C0EAB8DB78CC1330EBFB1BB4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_win32_FileChooser.cpp"; path = "../../../../modules/juce_gui_basics/native/juce_win32_FileChooser.cpp"; sourceTree = "SOURCE_ROOT"; };
C0EECABDA5446EAD76E2578F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_OpenGLImage.cpp"; path = "../../../../modules/juce_opengl/opengl/juce_OpenGLImage.cpp"; sourceTree = "SOURCE_ROOT"; };
C0F4014BD42C942094A65784 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MouseCursor.cpp"; path = "../../../../modules/juce_gui_basics/mouse/juce_MouseCursor.cpp"; sourceTree = "SOURCE_ROOT"; };
C10210AA8B1DD67E6943A2D4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_AffineTransform.h"; path = "../../../../modules/juce_graphics/geometry/juce_AffineTransform.h"; sourceTree = "SOURCE_ROOT"; };
C19ACBBBAFAB7161C4114966 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_LassoComponent.h"; path = "../../../../modules/juce_gui_basics/mouse/juce_LassoComponent.h"; sourceTree = "SOURCE_ROOT"; };
@@ -1788,6 +1790,8 @@
438CA87567F47F9AF39788D1,
153D339EB2CCEC711215AD04,
9B4278735225CBEED635FF03,
C0EECABDA5446EAD76E2578F,
4CE76ABC51CC5E019AED3C2B,
8BA1AF085755958342C9213A,
651055751E902F40B83EFD55,
09089786B542AEB678DDE38F ); name = opengl; sourceTree = "<group>"; };


+ 11
- 0
extras/audio plugin host/Builds/VisualStudio2005/Plugin Host.vcproj View File

@@ -4153,6 +4153,17 @@
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.cpp">
<FileConfiguration Name="Debug|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration Name="Release|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLPixelFormat.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.cpp">
<FileConfiguration Name="Debug|Win32"


+ 11
- 0
extras/audio plugin host/Builds/VisualStudio2008/Plugin Host.vcproj View File

@@ -4153,6 +4153,17 @@
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.cpp">
<FileConfiguration Name="Debug|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration Name="Release|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLPixelFormat.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.cpp">
<FileConfiguration Name="Debug|Win32"


+ 4
- 0
extras/static library/Builds/MacOSX/juce.xcodeproj/project.pbxproj View File

@@ -350,6 +350,7 @@
6D23CB93AC3337FE3FE828EA = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_android_Files.cpp"; path = "../../../../modules/juce_core/native/juce_android_Files.cpp"; sourceTree = "SOURCE_ROOT"; };
6D2F1CB1E2D41F3F92007063 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_XmlElement.h"; path = "../../../../modules/juce_core/xml/juce_XmlElement.h"; sourceTree = "SOURCE_ROOT"; };
6D95302F8D68BA3F0538214F = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_OpenGLPixelFormat.h"; path = "../../../../modules/juce_opengl/opengl/juce_OpenGLPixelFormat.h"; sourceTree = "SOURCE_ROOT"; };
6DCD8800E380DB691DC9D467 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_OpenGLImage.cpp"; path = "../../../../modules/juce_opengl/opengl/juce_OpenGLImage.cpp"; sourceTree = "SOURCE_ROOT"; };
6E139252275258AB625B98F2 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MouseListener.cpp"; path = "../../../../modules/juce_gui_basics/mouse/juce_MouseListener.cpp"; sourceTree = "SOURCE_ROOT"; };
6F0303127402D5BE3CC49299 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_InterprocessConnection.cpp"; path = "../../../../modules/juce_events/interprocess/juce_InterprocessConnection.cpp"; sourceTree = "SOURCE_ROOT"; };
6F6DA8FCAE092204FF7424DC = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_linux_Messaging.cpp"; path = "../../../../modules/juce_events/native/juce_linux_Messaging.cpp"; sourceTree = "SOURCE_ROOT"; };
@@ -363,6 +364,7 @@
715A22CF078EDEC96C0B4DC5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_OldSchoolLookAndFeel.h"; path = "../../../../modules/juce_gui_extra/lookandfeel/juce_OldSchoolLookAndFeel.h"; sourceTree = "SOURCE_ROOT"; };
716C4752D732744E8E99F51D = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_FileLogger.cpp"; path = "../../../../modules/juce_core/logging/juce_FileLogger.cpp"; sourceTree = "SOURCE_ROOT"; };
724F90F6B9BAA84B8C9AF73E = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ApplicationCommandInfo.h"; path = "../../../../modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h"; sourceTree = "SOURCE_ROOT"; };
7251827C30AC1C4F55C3DB69 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_OpenGLImage.h"; path = "../../../../modules/juce_opengl/opengl/juce_OpenGLImage.h"; sourceTree = "SOURCE_ROOT"; };
7302081CD2A56A32D5D11F3F = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_GraphicsContext.cpp"; path = "../../../../modules/juce_graphics/contexts/juce_GraphicsContext.cpp"; sourceTree = "SOURCE_ROOT"; };
7375D0E99E74C8FB7070A45B = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RelativeCoordinatePositioner.cpp"; path = "../../../../modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp"; sourceTree = "SOURCE_ROOT"; };
737A92AF4D1A15FAF9B399C4 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Thread.h"; path = "../../../../modules/juce_core/threads/juce_Thread.h"; sourceTree = "SOURCE_ROOT"; };
@@ -1707,6 +1709,8 @@
9D4FC9BEE122256B2557D088,
92346B7BA7AFD6750405F6F3,
AEB9A6FBC99A1C710C51D799,
6DCD8800E380DB691DC9D467,
7251827C30AC1C4F55C3DB69,
6D95302F8D68BA3F0538214F,
A0D54F01BC8018CC41FA34E9,
53B9B6090EDB9B6E0FA8577F ); name = opengl; sourceTree = "<group>"; };


+ 11
- 0
extras/static library/Builds/VisualStudio2008/juce.vcproj View File

@@ -4044,6 +4044,17 @@
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.cpp">
<FileConfiguration Name="Debug|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
<FileConfiguration Name="Release|Win32"
ExcludedFromBuild="true">
<Tool Name="VCCLCompilerTool"/>
</FileConfiguration>
</File>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLPixelFormat.h"/>
<File RelativePath="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.cpp">
<FileConfiguration Name="Debug|Win32"


+ 4
- 0
extras/static library/Builds/VisualStudio2010/juce.vcxproj View File

@@ -1099,6 +1099,9 @@
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@@ -1520,6 +1523,7 @@
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLContext.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLFrameBuffer.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLPixelFormat.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.h"/>
<ClInclude Include="..\..\..\..\modules\juce_opengl\juce_opengl.h"/>


+ 6
- 0
extras/static library/Builds/VisualStudio2010/juce.vcxproj.filters View File

@@ -1378,6 +1378,9 @@
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.cpp">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.cpp">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLTexture.cpp">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClCompile>
@@ -2607,6 +2610,9 @@
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLHelpers.h">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLImage.h">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_opengl\opengl\juce_OpenGLPixelFormat.h">
<Filter>Juce Modules\juce_opengl\opengl</Filter>
</ClInclude>


+ 1
- 0
modules/juce_opengl/juce_opengl.cpp View File

@@ -122,6 +122,7 @@
#include "opengl/juce_OpenGLComponent.cpp"
#include "opengl/juce_OpenGLFrameBuffer.cpp"
#include "opengl/juce_OpenGLHelpers.cpp"
#include "opengl/juce_OpenGLImage.cpp"
#include "opengl/juce_OpenGLTexture.cpp"
// END_AUTOINCLUDE


+ 3
- 0
modules/juce_opengl/juce_opengl.h View File

@@ -95,6 +95,9 @@ BEGIN_JUCE_NAMESPACE
#ifndef __JUCE_OPENGLHELPERS_JUCEHEADER__
#include "opengl/juce_OpenGLHelpers.h"
#endif
#ifndef __JUCE_OPENGLIMAGE_JUCEHEADER__
#include "opengl/juce_OpenGLImage.h"
#endif
#ifndef __JUCE_OPENGLPIXELFORMAT_JUCEHEADER__
#include "opengl/juce_OpenGLPixelFormat.h"
#endif


+ 2
- 0
modules/juce_opengl/opengl/juce_OpenGLHelpers.cpp View File

@@ -48,6 +48,8 @@ void OpenGLHelpers::prepareFor2D (int width, int height)
#else
glOrtho (0.0, width, 0.0, height, 0, 1);
#endif
glViewport (0, 0, width, height);
}
void OpenGLHelpers::setPerspective (double fovy, double aspect, double zNear, double zFar)


+ 193
- 0
modules/juce_opengl/opengl/juce_OpenGLImage.cpp View File

@@ -0,0 +1,193 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-11 by Raw Material Software Ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the GNU General
Public License (Version 2), as published by the Free Software Foundation.
A copy of the license is included in the JUCE distribution, or can be found
online at www.gnu.org/licenses.
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.rawmaterialsoftware.com/juce for more information.
==============================================================================
*/
BEGIN_JUCE_NAMESPACE
OpenGLFrameBufferImage::OpenGLFrameBufferImage (Image::PixelFormat format, int width, int height)
: Image::SharedImage (format, width, height),
pixelStride (4),
lineStride (width * pixelStride)
{
frameBuffer.initialise (width, height);
frameBuffer.clear (Colours::transparentBlack);
}
OpenGLFrameBufferImage::~OpenGLFrameBufferImage() {}
LowLevelGraphicsContext* OpenGLFrameBufferImage::createLowLevelContext()
{
return new LowLevelGraphicsSoftwareRenderer (Image (this));
}
Image::SharedImage* OpenGLFrameBufferImage::clone()
{
OpenGLFrameBufferImage* im = new OpenGLFrameBufferImage (getPixelFormat(), getWidth(), getHeight());
im->incReferenceCount();
{
Image newImage (im);
Graphics g (newImage);
g.drawImageAt (Image (this), 0, 0, false);
}
im->resetReferenceCount();
return im;
}
Image::ImageType OpenGLFrameBufferImage::getType() const
{
return Image::NativeImage;
}
namespace OpenGLImageHelpers
{
struct Dummy
{
Dummy (OpenGLFrameBuffer&, int, int, int, int) noexcept {}
static void read (OpenGLFrameBuffer&, Image::BitmapData& , int, int) noexcept {}
static void write (const void*) noexcept {}
};
struct Reader
{
static void read (OpenGLFrameBuffer& frameBuffer, Image::BitmapData& bitmapData, int x, int y)
{
if (frameBuffer.makeCurrentTarget())
{
OpenGLHelpers::prepareFor2D (frameBuffer.getWidth(), frameBuffer.getHeight());
glPixelStorei (GL_PACK_ALIGNMENT, 4);
glReadPixels (x, y, bitmapData.width, bitmapData.height, GL_RGBA, GL_UNSIGNED_BYTE, bitmapData.data);
frameBuffer.releaseCurrentTarget();
}
}
};
struct Writer
{
Writer (OpenGLFrameBuffer& frameBuffer_, int x, int y, int w, int h) noexcept
: frameBuffer (frameBuffer_), area (x, y, w, h)
{}
void write (const void* const data) const noexcept
{
if (frameBuffer.makeCurrentTarget())
{
OpenGLHelpers::prepareFor2D (frameBuffer.getWidth(), frameBuffer.getHeight());
glDisable (GL_DEPTH_TEST);
glDisable (GL_BLEND);
#if JUCE_OPENGL_ES
// GLES has no glDrawPixels function, so we have to create a texture and draw it..
GLuint temporaryTexture = 0;
glGenTextures (1, &temporaryTexture);
jassert (temporaryTexture != 0); // can't create a texture!
if (temporaryTexture != 0)
{
glEnable (GL_TEXTURE_2D);
glBindTexture (GL_TEXTURE_2D, temporaryTexture);
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, area.getWidth(), area.getHeight(), 0,
GL_BGRA_EXT, GL_UNSIGNED_BYTE, data);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
const int cropRect[4] = { 0, 0, area.getWidth(), area.getHeight() };
glTexParameteriv (GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, cropRect);
glDrawTexiOES (area.getX(), area.getY(), 1, area.getWidth(), area.getHeight());
glBindTexture (GL_TEXTURE_2D, 0);
glDeleteTextures (1, &temporaryTexture);
}
#else
glRasterPos2i (area.getX(), area.getY());
glBindTexture (GL_TEXTURE_2D, 0);
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
glDrawPixels (area.getWidth(), area.getHeight(), GL_BGRA_EXT, GL_UNSIGNED_BYTE, data);
#endif
frameBuffer.releaseCurrentTarget();
}
}
OpenGLFrameBuffer& frameBuffer;
const Rectangle<int> area;
JUCE_DECLARE_NON_COPYABLE (Writer);
};
template <class ReaderType, class WriterType>
struct DataReleaser : public Image::BitmapData::BitmapDataReleaser
{
DataReleaser (OpenGLFrameBuffer& frameBuffer, size_t dataSize, int x, int y, int w, int h)
: data (dataSize),
writer (frameBuffer, x, y, w, h)
{}
~DataReleaser()
{
writer.write (data);
}
static void initialise (OpenGLFrameBuffer& frameBuffer, Image::BitmapData& bitmapData, int x, int y)
{
DataReleaser* r = new DataReleaser (frameBuffer, bitmapData.lineStride * bitmapData.height,
x, y, bitmapData.width, bitmapData.height);
bitmapData.dataReleaser = r;
bitmapData.data = r->data + x * bitmapData.pixelStride + y * bitmapData.lineStride;
ReaderType::read (frameBuffer, bitmapData, x, y);
}
HeapBlock<uint8> data;
WriterType writer;
};
}
void OpenGLFrameBufferImage::initialiseBitmapData (Image::BitmapData& bitmapData, int x, int y,
Image::BitmapData::ReadWriteMode mode)
{
using namespace OpenGLImageHelpers;
bitmapData.pixelFormat = format;
bitmapData.lineStride = lineStride;
bitmapData.pixelStride = pixelStride;
switch (mode)
{
case Image::BitmapData::writeOnly: DataReleaser<Dummy, Writer>::initialise (frameBuffer, bitmapData, x, y); break;
case Image::BitmapData::readOnly: DataReleaser<Reader, Dummy> ::initialise (frameBuffer, bitmapData, x, y); break;
case Image::BitmapData::readWrite: DataReleaser<Reader, Writer>::initialise (frameBuffer, bitmapData, x, y); break;
default: jassertfalse; break;
}
}
END_JUCE_NAMESPACE

+ 70
- 0
modules/juce_opengl/opengl/juce_OpenGLImage.h View File

@@ -0,0 +1,70 @@
/*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-11 by Raw Material Software Ltd.
------------------------------------------------------------------------------
JUCE can be redistributed and/or modified under the terms of the GNU General
Public License (Version 2), as published by the Free Software Foundation.
A copy of the license is included in the JUCE distribution, or can be found
online at www.gnu.org/licenses.
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.rawmaterialsoftware.com/juce for more information.
==============================================================================
*/
#ifndef __JUCE_OPENGLIMAGE_JUCEHEADER__
#define __JUCE_OPENGLIMAGE_JUCEHEADER__
//==============================================================================
/**
A type of Image::SharedImage that stores its image data in an OpenGL
framebuffer, allowing a JUCE Image object to wrap a framebuffer.
By creating an Image from an instance of an OpenGLFrameBufferImage,
you can then use a Graphics object to draw into the framebuffer using normal
JUCE 2D operations.
@see Image, Image::SharedImage, OpenGLFrameBuffer
*/
class JUCE_API OpenGLFrameBufferImage : public Image::SharedImage
{
public:
OpenGLFrameBufferImage (Image::PixelFormat format, int width, int height);
/** Destructor. */
~OpenGLFrameBufferImage();
/** The underlying framebuffer.
Although this is exposed to allow access to use it as a texture, etc, be
careful not to change its size while the image is using it.
*/
OpenGLFrameBuffer frameBuffer;
/** @internal */
LowLevelGraphicsContext* createLowLevelContext();
/** @internal */
SharedImage* clone();
/** @internal */
Image::ImageType getType() const;
/** @internal */
void initialiseBitmapData (Image::BitmapData&, int, int, Image::BitmapData::ReadWriteMode);
private:
int pixelStride, lineStride;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OpenGLFrameBufferImage);
};
#endif // __JUCE_OPENGLIMAGE_JUCEHEADER__

Loading…
Cancel
Save