Skip to content

Commit

Permalink
Document new methods.
Browse files Browse the repository at this point in the history
* Loading/closing for font and surface.
  • Loading branch information
m1maker committed Jan 2, 2025
1 parent 79e3d23 commit cdbe66d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
8 changes: 3 additions & 5 deletions docs/Foundation/Namespaces/Global/Classes/renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,19 @@ The `renderer` class provides a data structure for handling rendering operations
- **Return Type**: texture@
- **Description**: Returns the current rendering target as a property.

### `bool set_logical_presentation(int w, int h, rendererlogicalpresentation mode, scalemode scale_mode)`
### `bool set_logical_presentation(int w, int h, rendererlogicalpresentation mode)`
- **Parameters**:
- `w` (int): The logical width.
- `h` (int): The logical height.
- `mode` (rendererlogicalpresentation): The presentation mode.
- `scale_mode` (scalemode): The scaling mode.
- **Return Type**: bool
**Return Type**: bool
- **Description**: Sets the logical presentation properties of the renderer.

### `bool get_logical_presentation(int&out w, int&out h, rendererlogicalpresentation&out mode, scalemode&out scale_mode)`
### `bool get_logical_presentation(int&out w, int&out h, rendererlogicalpresentation&out mode)`
- **Parameters**:
- `w` (int&out): Output parameter for the logical width.
- `h` (int&out): Output parameter for the logical height.
- `mode` (rendererlogicalpresentation&out): Output parameter for the presentation mode.
- `scale_mode` (scalemode&out): Output parameter for the scaling mode.
- **Return Type**: bool
- **Description**: Retrieves the logical presentation properties of the renderer.

Expand Down
45 changes: 34 additions & 11 deletions docs/Foundation/Namespaces/Global/Classes/surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,52 @@ The `surface` class provides a data structure for handling bitmap images and sur

## Constructors

### `surface(int width, int height, pixelformat format)`
### `surface(int width, int height, pixelformat format, const string&in pixels, int pitch)`
- **Parameters**:
- `width` (int): The width of the surface.
- `height` (int): The height of the surface.
- `format` (pixelformat): The pixel format for the surface.
- **Description**: Constructs a new `surface` object with the specified dimensions and pixel format.

### `surface(int width, int height, pixelformat format, uint64 pixels, int pitch)`
- **Parameters**:
- `width` (int): The width of the surface.
- `height` (int): The height of the surface.
- `format` (pixelformat): The pixel format for the surface.
- `pixels` (uint64): The memory buffer containing the pixel data.
- `pixels` (string): The memory buffer containing the pixel data.
- `pitch` (int): The pitch of the pixel data.
- **Description**: Constructs a new `surface` object with the specified dimensions, pixel format, and initial pixel data.

### `surface(const string&in filename)`
- **Parameters**:
- `filename` (const string&): The path to the image file.
- **Description**: Constructs a new `surface` object by loading an image from a file.
- `filename` (const string&): The path to the BMP file.
- **Description**: Constructs a new `surface` object by loading an image from a BMP file.

## Methods


### `bool load_bmp(const string& filename)`
- **Parameters**:
- `filename` (string): The path to the BMP file to be loaded.
- **Return Type**: bool
- **Description**: Loads a BMP image from the specified file and returns `true` if successful; otherwise, returns `false`.

### `bool load_from_pixels(int width, int height, pixelformat format, const string& pixels, int pitch)`
- **Parameters**:
- `width` (int): The width of the pixel data.
- `height` (int): The height of the pixel data.
- `format` (pixelformat): The pixel format of the data.
- `pixels` (string): The pixel data as a string.
- `pitch` (int): The pitch of the pixel data.
- **Return Type**: bool
- **Description**: Loads an image from raw pixel data and returns `true` if successful; otherwise, returns `false`.

### `bool load_from_memory(const string& data, uint64 size)`
- **Parameters**:
- `data` (string): The memory buffer containing the image data.
- `size` (uint64): The size of the memory buffer in bytes.
- **Return Type**: bool
- **Description**: Loads an image from a memory buffer and returns `true` if successful; otherwise, returns `false`.

### `void close()`
- **Parameters**:
- None
- **Return Type**: void
- **Description**: Closes the surface and releases any resources associated with it.

### `void set_colorspace(int colorspace) const property`
- **Parameters**:
- `colorspace` (int): The new color space.
Expand Down

0 comments on commit cdbe66d

Please sign in to comment.