Skip to content

Commit 5e2ab92

Browse files
committed
Getting rid of CCRenderTexture_Private.h
1 parent 6d1b6df commit 5e2ab92

File tree

5 files changed

+44
-58
lines changed

5 files changed

+44
-58
lines changed

cocos2d-ext/CCEffects/CCEffectNode.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
#import "Support/ccUtils.h"
1717
#import "Support/CCFileUtils.h"
1818
#import "Support/CGPointExtension.h"
19-
2019
#import "CCTexture.h"
2120
#import "CCDirector.h"
2221
#import "CCNode.h"
2322
#import "CCRenderer_Private.h"
24-
#import "CCRenderTexture_Private.h"
23+
#import "CCRenderTexture.h"
2524
#import "CCEffect.h"
2625

2726
#if __CC_PLATFORM_MAC

cocos2d-ext/CCEffects/CCEffectUtils.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import "CCEffectUtils.h"
10-
#import "CCRenderTexture_Private.h"
10+
#import "CCRenderTexture.h"
1111

1212
#ifndef BLUR_OPTIMIZED_RADIUS_MAX
1313
#define BLUR_OPTIMIZED_RADIUS_MAX 4UL

cocos2d/CCRenderTexture.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#import <UIKit/UIKit.h>
3636
#endif // iPHone
3737

38+
@class CCFrameBufferObject;
39+
3840
/**
3941
* Image format when saving render textures. Used by CCRenderTexture.
4042
*/
@@ -57,6 +59,29 @@ typedef NS_ENUM(NSInteger, CCRenderTextureImageFormat)
5759
There are also functions for saving the render texture to disk in PNG or JPG format.
5860
*/
5961
@interface CCRenderTexture : CCNode
62+
{
63+
64+
@protected
65+
GLenum _pixelFormat;
66+
GLuint _depthStencilFormat;
67+
68+
// Reference to the previous render to be restored by end.
69+
CCRenderer *_previousRenderer;
70+
71+
GLKVector4 _clearColor;
72+
73+
float _contentScale;
74+
75+
// Raw projection matrix used for rendering.
76+
// For metal will be flipped on the y-axis compared to the .projection property.
77+
GLKMatrix4 _projection;
78+
79+
CCSprite* _sprite;
80+
81+
CCFrameBufferObject *_framebuffer;
82+
83+
BOOL _contentSizeChanged;
84+
}
6085

6186
/**
6287
* @name Creating a Render Texture
@@ -316,5 +341,21 @@ typedef NS_ENUM(NSInteger, CCRenderTextureImageFormat)
316341

317342
#endif // __CC_PLATFORM_IOS
318343

344+
-(void)createTextureAndFboWithPixelSize:(CGSize)pixelSize;
345+
346+
-(void)destroy;
347+
348+
-(void)assignSpriteTexture;
349+
350+
@end
351+
352+
353+
354+
@interface CCRenderTextureSprite : CCSprite
355+
356+
@property (nonatomic, weak) CCRenderTexture *renderTexture;
357+
358+
- (CGAffineTransform)nodeToWorldTransform;
359+
319360
@end
320361

cocos2d/CCRenderTexture.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@
3232
#import "Support/ccUtils.h"
3333
#import "Support/CCFileUtils.h"
3434
#import "Support/CGPointExtension.h"
35-
3635
#import "CCRenderer_Private.h"
37-
#import "CCRenderTexture_Private.h"
36+
#import "CCRenderTexture.h"
3837
#import "CCRenderDispatch.h"
3938
#import "CCMetalSupport_Private.h"
4039

cocos2d/CCRenderTexture_Private.h

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)