BNBRenderTarget

Objective-C

@interface BNBRenderTarget : NSObject

/**@return render target name (string) */
- (nonnull NSString *)getName;

/**@param samples (int) msaa samples counts */
- (void)setSamplesCount:(int32_t)samples;

/**@return msaa samples counts */
- (int32_t)getSamplesCount;

/**
 *set render target surface extent
 *@param width (int): surface width
 *@param height (int): surface height
 */
- (void)setExtent:(int32_t)width
           height:(int32_t)height;

/**@return render target width (int) */
- (int32_t)getWidth;

/**@return render target height (int) */
- (int32_t)getHeight;

/**
 *set render target surface extent scale
 *@param width (int): surface width scale
 *@param height (int): surface height scale
 */
- (void)setScale:(float)scale;

/**@return render target width scale (int) */
- (float)getScale;

/**
 *add color or depth attachment to render target
 *@param attachment (image): surface attachment
 */
- (void)addAttachment:(nullable BNBImage *)attachment;

/**
 *removes color or depth attachment from render target, if it was aded early
 *@param attachment (image): surface attachment
 */
- (void)removeAttachment:(nullable BNBImage *)attachment;

/**@returns list of added attachments (list<image>). */
- (nonnull NSArray<BNBImage *> *)getAttachments;

/**request reading specific pixel from color attachment at the end of the frame */
- (void)requestReadPixel:(int32_t)x
                       y:(int32_t)y;

@end

Swift

class BNBRenderTarget : NSObject

Undocumented

  • Declaration

    Objective-C

    - (nonnull NSString *)getName;

    Swift

    func getName() -> String

    Return Value

    render target name (string)

  • Declaration

    Objective-C

    - (void)setSamplesCount:(int32_t)samples;

    Swift

    func setSamplesCount(_ samples: Int32)

    Parameters

    samples

    (int) msaa samples counts

  • Declaration

    Objective-C

    - (int32_t)getSamplesCount;

    Swift

    func getSamplesCount() -> Int32

    Return Value

    msaa samples counts

  • set render target surface extent

    Declaration

    Objective-C

    - (void)setExtent:(int32_t)width height:(int32_t)height;

    Swift

    func setExtent(_ width: Int32, height: Int32)

    Parameters

    width

    (int): surface width

    height

    (int): surface height

  • Declaration

    Objective-C

    - (int32_t)getWidth;

    Swift

    func getWidth() -> Int32

    Return Value

    render target width (int)

  • Declaration

    Objective-C

    - (int32_t)getHeight;

    Swift

    func getHeight() -> Int32

    Return Value

    render target height (int)

  • set render target surface extent scale

    Declaration

    Objective-C

    - (void)setScale:(float)scale;

    Swift

    func setScale(_ scale: Float)

    Parameters

    width

    (int): surface width scale

    height

    (int): surface height scale

  • Declaration

    Objective-C

    - (float)getScale;

    Swift

    func getScale() -> Float

    Return Value

    render target width scale (int)

  • add color or depth attachment to render target

    Declaration

    Objective-C

    - (void)addAttachment:(nullable BNBImage *)attachment;

    Swift

    func addAttachment(_ attachment: BNBImage?)

    Parameters

    attachment

    (image): surface attachment

  • removes color or depth attachment from render target, if it was aded early

    Declaration

    Objective-C

    - (void)removeAttachment:(nullable BNBImage *)attachment;

    Swift

    func removeAttachment(_ attachment: BNBImage?)

    Parameters

    attachment

    (image): surface attachment

  • @returns list of added attachments (list).

    Declaration

    Objective-C

    - (nonnull NSArray<BNBImage *> *)getAttachments;

    Swift

    func getAttachments() -> [BNBImage]
  • request reading specific pixel from color attachment at the end of the frame

    Declaration

    Objective-C

    - (void)requestReadPixel:(int32_t)x y:(int32_t)y;

    Swift

    func requestReadPixel(_ x: Int32, y: Int32)