HaxeFlixel / HaxeFlixel/flixel
Split parts of the draw method
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
While poking through more of the changes made in Beeblerox's renderer overhaul branch, I noticed that the way the draw method works has changed quite a bit! Instead of a single draw() method that handles everything, two more were introduced: preDrawCheck() and drawTo(camera), with draw() being reduced to just:
override public function draw():Void
{
if (!preDrawCheck())
return;
for (camera in cameras)
drawTo(camera);
}
I think the way this was split is nice, and could make overrides less of a pain. The drawTo() method especially could be really nice if you had to force a draw on a specific camera, in the case of render textures or whatever.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the repository for the current draw() implementation and its renderer class, then compare how camera iteration and draw checks are handled. The issue proposes separating preDrawCheck() and drawTo(camera); done would mean the intended split is implemented without changing existing rendering behavior, with any relevant renderer tests or examples still passing.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100