Skip to content

Commit

Permalink
Add issue markdown files. Prepare for texture feature branch. Small c…
Browse files Browse the repository at this point in the history
…leanup. (#44)
  • Loading branch information
jamesaorson authored Jun 19, 2024
1 parent 363eec1 commit 7a84338
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 19 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
matrix:
configuration:
- Debug
Expand Down
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Contributing

# Technical Knowledge Prerequisite
## Technical Knowledge Prerequisite

- Understand the [Learn OpenGL tutorial up to and including this lesson](https://learnopengl.com/Getting-started/Hello-Triangle)

## What can I work on?

Check out the [open issues file](./issues/open.md) to understand what work needs to be done.

## Why is there an issue tracker in the codebase and in our SCM solution?

Github does provide nice linking to issues for PRs and for the community to add issues to the project without having code access. The issues markdown files in the repo should be represented in Github as well, but are usually of higher priority and more immediately available to be worked on.
18 changes: 1 addition & 17 deletions examples/Playground/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,16 @@ type GameState =
Triangles = Primitives.ShadedObject.Default }

let private initHandler (config:Config<GameState>) =
let state = config.State
let fragmentPaths = ["Resources/Shaders/fragment.glsl"]
let vertexPaths = ["Resources/Shaders/vertex.glsl"]
let vertices = [|
0.0f; -0.5f; 0.0f; // shared vertex
// first triangle
-0.9f; -0.5f; 0.0f; // left vertex
-0.45f; 0.5f; 0.0f; // top vertex
// second triangle
0.9f; -0.5f; 0.0f; // right vertex
0.45f; 0.5f; 0.0f; // top vertex
|]
let indices = [|
0u; 1u; 2u; // first triangle vertex order as array indices
0u; 3u; 4u; // second triangle vertex order as array indices
|]
let transform =
{ Transform.Default() with
Scale = (1.0f, 1.0f, 1.0f)
Rotation = (0.0f, 0.0f, 0.0f) }
match Primitives.ShadedObject.CreateQuad vertexPaths fragmentPaths transform 1.8f 1.0f with
| Some primitive ->
{ config with
State =
{ GameState.Default with
Triangles = primitive }}
State.Triangles = primitive }
| None ->
Logging.fail "Failed to create initial game state"
config
Expand Down
Binary file not shown.
5 changes: 5 additions & 0 deletions issues/closed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Open Issues

Move [in-progress](./in-progress.md) issues to this file when completed

- [Closed issues search](https://github.com/ExoKomodo/openwomb/issues?q=is%3Aissue+is%3Aclosed)
29 changes: 29 additions & 0 deletions issues/in-progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# In-Progress Issues

Once completed, move the issue into [closed](./closed.md), and also close it within the [Official Issue Tracker](https://github.com/exokomodo/openwomb/issues)

## Render textures/sprites

### [Issue Link](https://github.com/ExoKomodo/openwomb/issues/3)

### Branch - [3_sprites](https://github.com/exokomodo/openwomb/tree/3_sprites)

### Overview

There are 2 different ways to render images with SDL:

1. Using [SDL_Texture](https://lazyfoo.net/tutorials/SDL/07_texture_loading_and_rendering/index.php) (terrible option for general use but great for low-overhead texturing)
1. Using OpenGL to render textures in a shader (best option for overall usage)

This issue is to only implement the OpenGL way, as it provides a general-purpose use case, since rendering to a quad is all that is "needed" for dealing with images and textures in graphics.

### Instructions

1. Read the [OpenGL tutorial for rendering textures to a quad](https://learnopengl.com/Getting-started/Textures). Now prepare for implementation.
1. Will require some changes to the [Primitives.ShadedObject.From function](./src/Womb/Graphics/Primitives.fs)
1. Will require some changes to the [Primitives.ShadedObject.UseMvpShader function](./src/Womb/Graphics/Primitives.fs)
1. Will require some changes to the [example shaders in the Playground example](./examples/Playground/Resources/Shaders/)

### Acceptance Criteria

Be able to render an image to a shaded quad. To demonstrate this, modify the [Playground example](./examples/Playground) to render the [hello_world.bmp](./examples/Playground/Resources/Textures/hello_world.bmp). For proper completeness, demonstrate how we can color the texture in the shader as well.
3 changes: 3 additions & 0 deletions issues/open.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Open Issues

- [Open issues search](https://github.com/ExoKomodo/openwomb/issues?q=is%3Aissue+is%3Aopen+no%3Aassignee)

0 comments on commit 7a84338

Please sign in to comment.