HaxeFlixel / HaxeFlixel/flixel

Split parts of the draw method

Open
#3,552 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.