Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
d390790
Implement FlxCameraView & port blit/quad renderer
ACrazyTown Dec 23, 2025
1acebed
Merge remote-tracking branch 'upstream/dev' into seperate-renderer
ACrazyTown Dec 23, 2025
1b1a5a0
merge some fixes from upstream cus im dumb and on an old branch!!
ACrazyTown Dec 23, 2025
66c64bd
formatting
ACrazyTown Dec 23, 2025
a0861e9
Add debug drawing methods to `FlxCamera` and `FlxCameraView`
ACrazyTown Dec 23, 2025
2d4eacb
FlxQuadView: wrap debug draw methods in FLX_DEBUG
ACrazyTown Dec 23, 2025
0721511
use FlxCameraView to count draw calls
ACrazyTown Dec 24, 2025
f45d5a1
Fix filters
ACrazyTown Dec 24, 2025
5a81eaf
drawDebugCircle -> drawDebugFilledCircle
ACrazyTown Dec 24, 2025
dfd4604
move view margins back to FlxCamera
ACrazyTown Dec 24, 2025
3cd97d9
redo unlock/lock
ACrazyTown Dec 24, 2025
1998f39
A bunch of deprecations
ACrazyTown Dec 24, 2025
d7c4f9e
missed this deprecation
ACrazyTown Dec 24, 2025
50357c7
checkResize() shouldn't be a global thing
ACrazyTown Dec 24, 2025
ac364da
FlxRenderer draft
ACrazyTown Jan 22, 2026
08b0993
some polishing in progress
ACrazyTown Jan 23, 2026
af8a67a
oops
ACrazyTown Jan 23, 2026
5cf309c
fixes and a whole lot of docs
ACrazyTown Jan 24, 2026
552bdb7
fix debug drawing
ACrazyTown Jan 24, 2026
f4775d5
fix flash
ACrazyTown Jan 24, 2026
79fd40f
fix deprecation warnings
ACrazyTown Jan 24, 2026
468f65e
update some more docs
ACrazyTown Jan 24, 2026
726c0be
change `method == DRAW_TILES` checks into `method != BLITTING`
ACrazyTown Jan 25, 2026
9441d8c
Make `FlxCameraView.create()` dynamic
ACrazyTown Jan 25, 2026
181cec8
change import
Geokureli Jan 26, 2026
fb9d27c
Bring back accidentally removed method
ACrazyTown Jan 26, 2026
52342c8
Merge branch 'seperate-renderer' of https://github.com/ACrazyTown/fli…
ACrazyTown Jan 26, 2026
f45c61e
fix line debug draw
ACrazyTown Jan 26, 2026
b4c0c8a
Fix C++ CI
ACrazyTown Jan 27, 2026
39b08ce
no longer need to recreate MatrixVector in ReusableFrame
ACrazyTown Jan 27, 2026
51ffbed
some hail mary stuff
Geokureli Feb 24, 2026
1043633
fix debug draw
Geokureli Feb 25, 2026
b6fc6bb
move some rendereer methods to view
Geokureli Feb 26, 2026
bb17eb1
whitespace
Geokureli Feb 26, 2026
9bfbcee
organize methods
Geokureli Feb 26, 2026
dc6102d
use existing drawDebug methods
Geokureli Feb 26, 2026
8362c91
use existing debug draw methods to prevent breaking changes in overrides
Geokureli Feb 26, 2026
29d23c8
make FlxRenderer an abstract class
Geokureli Feb 26, 2026
bf58333
remove targetGraphics from quad view
Geokureli Feb 26, 2026
29684d7
add createView for custom views
Geokureli Feb 26, 2026
e5267a4
revert offset in drawDebugLine
Geokureli Feb 27, 2026
0ad6a68
doc
Geokureli Feb 27, 2026
1c9c167
make viewQuad and viewBlit private
Geokureli Feb 27, 2026
1d4937c
deprecate transformObject
Geokureli Feb 27, 2026
e43175f
call calc in camera, not view
Geokureli Feb 27, 2026
840ff6d
rework and group deprecated getters
Geokureli Feb 27, 2026
5f8516b
fix bitmap text
Geokureli Feb 27, 2026
23af18d
remove display
Geokureli Feb 27, 2026
0a0b357
Merge branch 'dev' into seperate-renderer
Geokureli Feb 27, 2026
4c7cd52
Merge branch 'seperate-renderer' into geo-separate-renderer
Geokureli Feb 27, 2026
d2c7dd1
more bitmap text fixes
Geokureli Feb 27, 2026
caca90a
whitespace + view creation
Geokureli Feb 27, 2026
8b34e47
and FlxG.renderer.blit and tile
Geokureli Feb 27, 2026
d3def2f
add initGlobals
Geokureli Feb 28, 2026
74a38f4
view/cam setters/getters
Geokureli Mar 3, 2026
3a404ce
add FlxVertexBuffer to wrap Graphics calls
Geokureli Mar 8, 2026
b2d0777
tiny fixes
Geokureli Mar 8, 2026
7b0e049
add accidentally removed method
Geokureli Mar 8, 2026
8f7cc5e
remove missed ref to view.display
Geokureli Mar 12, 2026
6fc5b80
Use abstracts unless there are default values
Geokureli Mar 12, 2026
2e8dbbb
move rendering methods to view
Geokureli Mar 12, 2026
59b4346
split TrackerProfile from Tracker
Geokureli Mar 13, 2026
b19f593
split copyPixels/drawPixels into copyFrame/drawFrame
Geokureli Mar 13, 2026
e78983a
change statics to instance vars
Geokureli Mar 13, 2026
4fd4035
Update flixel/system/debug/stats/Stats.hx
Geokureli Mar 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,719 changes: 759 additions & 960 deletions flixel/FlxCamera.hx

Large diffs are not rendered by default.

65 changes: 31 additions & 34 deletions flixel/FlxG.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import flixel.system.frontEnds.SignalFrontEnd;
import flixel.system.frontEnds.SoundFrontEnd;
import flixel.system.frontEnds.VCRFrontEnd;
import flixel.system.frontEnds.WatchFrontEnd;
import flixel.system.render.FlxRenderer;
import flixel.system.scaleModes.BaseScaleMode;
import flixel.system.scaleModes.RatioScaleMode;
import flixel.util.FlxCollision;
Expand Down Expand Up @@ -143,10 +144,33 @@ class FlxG
*/
public static var onMobile(get, never):Bool;

public static var renderMethod(default, null):FlxRenderMethod;
@:deprecated("renderMethod is deprecated, use FlxG.renderer.method, instead.")
public static var renderMethod(get, null):flixel.system.render.FlxRenderer.FlxRenderMethod;
@:noCompletion static inline function get_renderMethod():flixel.system.render.FlxRenderer.FlxRenderMethod
{
return renderer.method;
}

@:deprecated("renderBlit is deprecated, compare against FlxG.renderer.blit, instead.")
public static var renderBlit(get, never):Bool;
@:noCompletion static inline function get_renderBlit():Bool
{
return renderer.blit;
}

@:deprecated("renderTile is deprecated, compare against FlxG.renderer.tile, instead.")
public static var renderTile(get, never):Bool;
@:noCompletion static inline function get_renderTile():Bool
{
return renderer.tile;
}

public static var renderBlit(default, null):Bool;
public static var renderTile(default, null):Bool;
/**
* The global renderer instance.
*
* @see `FlxRenderer`
*/
public static var renderer(default, null):FlxRenderer;

/**
* Represents the amount of time in seconds that passed since last frame.
Expand Down Expand Up @@ -541,10 +565,6 @@ class FlxG
FlxG.height = height;

initRenderMethod();
#if FLX_OPENGL_AVAILABLE
// Query once when window is created and cache for later
bitmap.get_maxTextureSize();
#end

FlxG.initialWidth = width;
FlxG.initialHeight = height;
Expand Down Expand Up @@ -590,28 +610,8 @@ class FlxG

static function initRenderMethod():Void
{
#if !flash
renderMethod = switch (stage.window.context.type)
{
case OPENGL, OPENGLES, WEBGL: DRAW_TILES;
default: BLITTING;
}
#else
#if web
renderMethod = BLITTING;
#else
renderMethod = DRAW_TILES;
#end
#end

#if air
renderMethod = BLITTING;
#end

renderBlit = renderMethod == BLITTING;
renderTile = renderMethod == DRAW_TILES;

FlxObject.defaultPixelPerfectPosition = renderBlit;
renderer = FlxRenderer.create();
renderer.initGlobals();
}

#if FLX_SAVE
Expand Down Expand Up @@ -750,8 +750,5 @@ class FlxG
}
}

enum FlxRenderMethod
{
DRAW_TILES;
BLITTING;
}
@:deprecated("FlxG.FlxRenderMethod is deprecated, use FlxRenderer.FlxRenderMethod instead")
typedef FlxRenderMethod = flixel.system.render.FlxRenderer.FlxRenderMethod;
17 changes: 7 additions & 10 deletions flixel/FlxGame.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package flixel;

import flixel.graphics.tile.FlxDrawBaseItem;
import flixel.system.FlxSplash;
import flixel.system.render.FlxRenderer;
import flixel.util.FlxArrayUtil;
import flixel.util.FlxDestroyUtil;
import flixel.util.typeLimit.NextState;
Expand Down Expand Up @@ -803,10 +803,9 @@ class FlxGame extends Sprite

FlxG.signals.preDraw.dispatch();

if (FlxG.renderTile)
FlxDrawBaseItem.drawCalls = 0;
FlxG.renderer.totalDrawCalls = 0;

FlxG.cameras.lock();
FlxG.cameras.clear();

if (FlxG.plugins.drawOnTop)
{
Expand All @@ -819,17 +818,15 @@ class FlxGame extends Sprite
_state.draw();
}

if (FlxG.renderTile)
{
FlxG.cameras.render();
FlxG.cameras.render();

if (FlxG.renderer.tile)
{
#if FLX_DEBUG
debugger.stats.drawCalls(FlxDrawBaseItem.drawCalls);
debugger.stats.drawCalls(FlxG.renderer.totalDrawCalls);
#end
}

FlxG.cameras.unlock();

FlxG.signals.postDraw.dispatch();

#if FLX_DEBUG
Expand Down
53 changes: 33 additions & 20 deletions flixel/FlxObject.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.math.FlxVelocity;
import flixel.path.FlxPath;
import flixel.system.render.FlxCameraView;
import flixel.system.render.FlxVertexBuffer;
import flixel.tile.FlxBaseTilemap;
import flixel.util.FlxAxes;
import flixel.util.FlxColor;
Expand Down Expand Up @@ -1306,9 +1308,11 @@ class FlxObject extends FlxBasic
{
if (!camera.visible || !camera.exists || !isOnScreen(camera))
return;

final rect = getBoundingBox(camera);
if (FlxG.renderTile)

// TODO: Remove and handle this in the view via drawDebugRect
if (FlxG.renderer.tile)
{
final view = camera.getViewMarginRect();
view.pad(2);
Expand All @@ -1318,19 +1322,27 @@ class FlxObject extends FlxBasic

if (rect.width > 0 && rect.height > 0)
{
final gfx = beginDrawDebug(camera);
drawDebugBoundingBox(gfx, rect, allowCollisions, immovable);
endDrawDebug(camera);
camera.view.beginDrawDebug();
drawDebugBoundingBoxTo(camera.view.getDebugBuffer(), rect);
camera.view.endDrawDebug();
}
}

// TODO: throw warning on overrides
@:deprecated("drawDebugBoundingBox is deprecated, use drawDebugBoundingBoxTo instead") // 6.2.0
function drawDebugBoundingBox(gfx:Graphics, rect:FlxRect, allowCollisions:FlxDirectionFlags, partial:Bool)
{
// Find the color to use
final color = getDebugBoundingBoxColor(allowCollisions);
drawDebugBoundingBoxColor(gfx, rect, color);
}

@:haxe.warning("-WDeprecated")
function drawDebugBoundingBoxTo(buffer:FlxVertexBuffer, rect:FlxRect)
{
drawDebugBoundingBox(buffer, rect, allowCollisions, immovable);
}

function getDebugBoundingBoxColor(allowCollisions:FlxDirectionFlags)
{
if (debugBoundingBoxColor != null)
Expand All @@ -1346,30 +1358,31 @@ class FlxObject extends FlxBasic

}

// TODO: throw warning on overrides
@:deprecated("beginDrawDebug(gfx) is deprecated, drawDebugBoundingBoxTo instead")
function drawDebugBoundingBoxColor(gfx:Graphics, rect:FlxRect, color:FlxColor)
{
// fill static graphics object with square shape
gfx.lineStyle(1, color, 0.75, false, null, null, MITER, 255);
gfx.drawRect(rect.x + 0.5, rect.y + 0.5, rect.width - 1.0, rect.height - 1.0);
final buffer:FlxVertexBuffer = gfx;
buffer.drawRect(rect.x + 0.5, rect.y + 0.5, rect.width - 1.0, rect.height - 1.0, color, 1);
}


@:haxe.warning("-WDeprecated")
function drawDebugBoundingBoxColorTo(view:FlxCameraView, bounds:FlxRect, color:FlxColor)
{
drawDebugBoundingBoxColor(view.getDebugBuffer(), bounds, color);
}

@:deprecated("beginDrawDebug(camera) is deprecated, use camera.view.beginDrawDebug() instead")
inline function beginDrawDebug(camera:FlxCamera):Graphics
{
if (FlxG.renderBlit)
{
FlxSpriteUtil.flashGfx.clear();
return FlxSpriteUtil.flashGfx;
}
else
{
return camera.debugLayer.graphics;
}
camera.view.beginDrawDebug();
return camera.view.getDebugBuffer();
}

@:deprecated("endDrawDebug(camera) is deprecated, use camera.view.endDrawDebug() instead")
inline function endDrawDebug(camera:FlxCamera)
{
if (FlxG.renderBlit)
camera.buffer.draw(FlxSpriteUtil.flashGfxSprite);
camera.view.endDrawDebug();
}
#end

Expand Down
Loading
Loading