JubeatPlus 3.9.11
Loading...
Searching...
No Matches
Texture2D.h
Go to the documentation of this file.
1
16
17#import <Foundation/Foundation.h>
18#import <OpenGLES/gltypes.h>
19#import <UIKit/UIKit.h>
20
21NS_ASSUME_NONNULL_BEGIN
22
35
39@interface Texture2D : NSObject
40
53+ (CGRect)scaledRect:(CGRect)rect scale:(double)scale anchor:(CGPoint)anchor;
54
60- (instancetype)init;
61
76- (void)setData:(nullable const void *)data
77 pixelFormat:(Texture2DPixelFormat)pixelFormat
78 pixelSize:(GLuint)pixelSize
79 width:(int)width
80 height:(int)height;
81
89- (void)setData:(nullable const void *)data
90 pixelFormat:(Texture2DPixelFormat)pixelFormat
91 pixelSize:(GLuint)pixelSize;
92
103- (instancetype)initWithData:(nullable const void *)data
104 pixelFormat:(Texture2DPixelFormat)pixelFormat
105 pixelSize:(GLuint)pixelSize
106 width:(int)width
107 height:(int)height;
108
117- (instancetype)initWithData:(nullable const void *)data
118 pixelFormat:(Texture2DPixelFormat)pixelFormat
119 pixelSize:(GLuint)pixelSize;
120
133- (instancetype)initWithImage:(nullable UIImage *)image;
134
145- (void)setSubImage:(nullable UIImage *)image inRect:(CGRect)rect;
146
153- (void)setSubImage:(nullable UIImage *)image atPoint:(CGPoint)point;
154
165- (void)drawAtPoint:(CGPoint)point scale:(double)scale;
166
176- (void)drawInRect:(CGRect)rect
177 fromRegion:(CGRect)region
178 transform:(char)transform
179 color:(nullable UIColor *)color;
180
190- (void)drawInRect:(CGRect)rect
191 fromRegion:(CGRect)region
192 transform:(char)transform
193 alpha:(float)alpha;
194
211- (void)drawSprite:(NSUInteger)sprite
212 atPoint:(CGPoint)point
213 scale:(float)scale
214 rotate:(float)rotate
215 anchor:(CGPoint)anchor
216 transform:(char)transform
217 alpha:(float)alpha;
218
231- (void)drawSprite:(NSUInteger)sprite
232 atPoint:(CGPoint)point
233 transform:(char)transform
234 alpha:(float)alpha;
235
244- (void)drawSprite:(NSUInteger)sprite
245 inRect:(CGRect)rect
246 transform:(char)transform
247 alpha:(float)alpha;
248
255- (void)drawSprite:(NSUInteger)sprite atPoint:(CGPoint)point;
256
264- (void)drawSprite:(NSUInteger)sprite inRect:(CGRect)rect color:(nullable UIColor *)color;
265
272- (void)drawSprite:(NSUInteger)sprite inRect:(CGRect)rect;
273
282- (void)commitDraw;
283
288- (void)resetDrawBuffer;
289
299- (void)setSprites:(nullable NSArray<NSArray<NSNumber *> *> *)sprites;
300
307- (CGRect)spriteAtIndex:(unsigned int)index;
308
317- (void)setClipRect:(CGRect)rect;
318
323@property(nonatomic) BOOL isScale2x;
324
329@property(nonatomic, readonly) GLuint name;
330
335@property(nonatomic, readonly) NSUInteger width;
336
341@property(nonatomic, readonly) NSUInteger height;
342
343@end
344
345NS_ASSUME_NONNULL_END
346
347// code: language=Objective-C
348// kate: hl Objective-C;
349// vim: set ft=objc :
Texture2DPixelFormat
The internal storage format of a texture, chosen when its pixels are uploaded.
Definition Texture2D.h:30
@ Texture2DPixelFormatRGB888
Three bytes per pixel, uploaded as GL_RGB .
Definition Texture2D.h:32
@ Texture2DPixelFormatRGBA8888
Four bytes per pixel, uploaded as GL_RGBA .
Definition Texture2D.h:31
@ Texture2DPixelFormatA8
One byte per pixel, uploaded as GL_ALPHA .
Definition Texture2D.h:33
A texture that can draw any of the sprites packed into it.
Definition Texture2D.h:40
BOOL isScale2x
Whether packed sprites are treated as 2x-supersampled and drawn at half size.
Definition Texture2D.h:323
void resetDrawBuffer()
Discards every batched quad without drawing.
Definition Texture2D.mm:725
void commitDraw()
Flushes every batched quad in one glDrawElements , honouring the clip rectangle.
Definition Texture2D.mm:697
instancetype init()
Initialises an empty texture with no GL name and a null clip rectangle.
Definition Texture2D.mm:62
NSUInteger height
The content height in texels.
Definition Texture2D.h:341
NSUInteger width
The content width in texels.
Definition Texture2D.h:335
GLuint name
The GL texture name, or 0 when no data has been uploaded.
Definition Texture2D.h:329