Skip to content

Commit 62b2ec3

Browse files
authored
Merge pull request #1 from jdolan/jdolan-objectivelygpu-doxygen-pages
Add GitHub Pages Doxygen documentation
2 parents e3f09e6 + 2dd7306 commit 62b2ec3

6 files changed

Lines changed: 479 additions & 17 deletions

File tree

.github/copilot-instructions.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Class *_Foo(void) {
180180
```
181181
Sources/ObjectivelyGPU/ Core classes
182182
Types.h GPU_Assert, SDL_Size, MakeRect/Size/Point
183-
RenderDevice.{h,c} Owns SDL_GPUDevice, window, frame loop, Drawables
183+
RenderDevice.{h,c} Owns SDL_GPUDevice, window, and frame loop
184184
CommandBuffer.{h,c} Wraps SDL_GPUCommandBuffer for one frame
185185
RenderPass.{h,c} Wraps SDL_GPURenderPass (draw commands)
186186
CopyPass.{h,c} Wraps SDL_GPUCopyPass (CPU→GPU uploads)
@@ -219,22 +219,6 @@ The caller sets `stage`, `entrypoint`, and binding counts; `code`, `code_size`,
219219
220220
All `SDL_GPU*` resources (buffers, textures, pipelines, samplers, shaders, transfer buffers, fences) are released through the corresponding `RenderDevice::release*` method, never through `release()`.
221221
222-
### Drawable — Lightweight Frame Hooks
223-
224-
Use `Drawable` (a plain C struct, not a class) to participate in the frame loop without subclassing `RenderDevice`:
225-
226-
```c
227-
$(device, addDrawable, &(Drawable) {
228-
.deviceDidReset = myAllocGPUResources,
229-
.deviceWillReset = myFreeGPUResources,
230-
.transfer = myUploadData, // called when isDirty == true
231-
.submit = myDrawCommands,
232-
.data = myContext,
233-
});
234-
```
235-
236-
Set `drawable->isDirty = true` to trigger `transfer()` on the next frame; it is reset to `false` automatically after `transfer()` returns.
237-
238222
---
239223
240224
## ObjectivelyMVC Integration

.github/workflows/docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v6
23+
24+
- name: Install Doxygen
25+
run: sudo apt-get update && sudo apt-get install -y doxygen
26+
27+
- name: Clone doxygen-awesome-css
28+
run: git clone --depth 1 https://github.com/jothepro/doxygen-awesome-css.git doxygen-awesome-css
29+
30+
- name: Build documentation
31+
run: doxygen Doxyfile
32+
33+
- name: Upload Pages artifact
34+
uses: actions/upload-pages-artifact@v3
35+
with:
36+
path: Documentation/html
37+
deploy:
38+
needs: build
39+
runs-on: ubuntu-latest
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4

Documentation/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ObjectivelyGPU {#index}
2+
===============
3+
4+
[ObjectivelyGPU](https://github.com/jdolan/ObjectivelyGPU) is an object-oriented wrapper around [SDL3](https://libsdl.org)'s GPU API for [GNU C](https://www.gnu.org/software/gnu-c-manual/). It builds on [Objectively](https://github.com/jdolan/Objectively) to deliver a clean, idiomatic C API for modern GPU programming.
5+
6+
## Features
7+
8+
- **RenderDevice** — device creation, buffer/texture/sampler allocation, and shader pipeline compilation
9+
- **CommandBuffer** — render, compute, and copy command recording
10+
- **RenderPass**, **ComputePass**, **CopyPass** — typed command encoder wrappers
11+
- Shader compilation via [SDL_shadercross](https://github.com/libsdl-org/SDL_shadercross) (HLSL → SPIR-V / MSL / DXIL)
12+
- macOS and iOS (Metal), Windows (Direct3D 12), Linux (Vulkan) via SDL3 backends
13+
14+
## API
15+
16+
Browse the [class hierarchy](hierarchy.html) to navigate the API.
17+
18+
## Building
19+
20+
```sh
21+
autoreconf -i
22+
./configure
23+
make && sudo make install
24+
```

Doxyfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
DOXYFILE_ENCODING = UTF-8
2+
PROJECT_NAME = "ObjectivelyGPU"
3+
PROJECT_NUMBER =
4+
PROJECT_BRIEF = "Object oriented GPU framework for SDL3 and GNU C"
5+
PROJECT_LOGO =
6+
OUTPUT_DIRECTORY = Documentation
7+
OUTPUT_LANGUAGE = English
8+
OPTIMIZE_OUTPUT_FOR_C = YES
9+
EXTRACT_ALL = YES
10+
EXTRACT_PRIVATE = NO
11+
EXTRACT_STATIC = YES
12+
EXTRACT_LOCAL_CLASSES = YES
13+
GENERATE_TODOLIST = YES
14+
GENERATE_TESTLIST = YES
15+
GENERATE_BUGLIST = YES
16+
GENERATE_DEPRECATEDLIST= YES
17+
INPUT = Documentation/index.md Sources
18+
INPUT_ENCODING = UTF-8
19+
RECURSIVE = YES
20+
EXCLUDE_SYMBOLS = *Interface
21+
USE_MDFILE_AS_MAINPAGE = Documentation/index.md
22+
GENERATE_HTML = YES
23+
HTML_OUTPUT = html
24+
HTML_FILE_EXTENSION = .html
25+
HTML_HEADER =
26+
HTML_FOOTER =
27+
HTML_STYLESHEET =
28+
HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css \
29+
doxygen-awesome-css/doxygen-awesome-sidebar-only.css
30+
HTML_EXTRA_FILES = doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js \
31+
doxygen-awesome-css/doxygen-awesome-paragraph-link.js \
32+
doxygen-awesome-css/doxygen-awesome-interactive-toc.js
33+
HTML_COLORSTYLE = LIGHT
34+
GENERATE_TREEVIEW = YES
35+
DISABLE_INDEX = NO
36+
FULL_SIDEBAR = NO
37+
TREEVIEW_WIDTH = 250
38+
SEARCHENGINE = YES
39+
GENERATE_LATEX = NO
40+
GENERATE_MAN = NO
41+
HAVE_DOT = NO

ObjectivelyGPU.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@
113113
CEEAAFF82FED833A00FFEBE6 /* Makefile.am */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
114114
CEEAAFFA2FED833A00FFEBE6 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
115115
CEEAAFFD2FED83E400FFEBE6 /* configure.ac */ = {isa = PBXFileReference; lastKnownFileType = text; path = configure.ac; sourceTree = "<group>"; };
116+
DOC00010000000000000001 /* index.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = index.md; sourceTree = "<group>"; };
117+
DOC00020000000000000001 /* Doxyfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Doxyfile; sourceTree = "<group>"; };
116118
E71C479F7B60345FDDA44201 /* CommandBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommandBuffer.h; sourceTree = "<group>"; };
117119
ED8024CA4186E352C1EC4CA1 /* ComputePass.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ComputePass.c; sourceTree = "<group>"; };
118120
EE00010000000000000000B1 /* Hello.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = Hello.c; sourceTree = "<group>"; };
@@ -182,9 +184,19 @@
182184
CEEAAFF82FED833A00FFEBE6 /* Makefile.am */,
183185
CEEAAFFA2FED833A00FFEBE6 /* README.md */,
184186
CEEAAFFD2FED83E400FFEBE6 /* configure.ac */,
187+
DOC00030000000000000001 /* Documentation */,
188+
DOC00020000000000000001 /* Doxyfile */,
185189
);
186190
sourceTree = "<group>";
187191
};
192+
DOC00030000000000000001 /* Documentation */ = {
193+
isa = PBXGroup;
194+
children = (
195+
DOC00010000000000000001 /* index.md */,
196+
);
197+
path = Documentation;
198+
sourceTree = "<group>";
199+
};
188200
904A6003E847F129BD1EE63E /* Sources */ = {
189201
isa = PBXGroup;
190202
children = (

0 commit comments

Comments
 (0)