Skip to content

Commit 14ca40a

Browse files
authored
1080 support for SparkGL (#2227)
* 1080 support for SparkGL * add capability for 1080
1 parent 1cfec8c commit 14ca40a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

examples/pxScene2d/src/pxScene2d.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ pxScene2d::pxScene2d(bool top, pxScriptView* scriptView)
569569
//
570570
// capabilities.video.player = 1
571571
// capabilities.sparkgl.nativedrawing = 1
572+
// capabilities.sparkgl.supports1080 = 1
572573

573574
mCapabilityVersions = new rtMapObject;
574575

@@ -675,6 +676,7 @@ pxScene2d::pxScene2d(bool top, pxScriptView* scriptView)
675676
sparkGlCapabilities.set("nativedrawing", 0);
676677
}
677678
}
679+
sparkGlCapabilities.set("supports1080", 1);
678680
mCapabilityVersions.set("sparkgl", sparkGlCapabilities);
679681

680682
//////////////////////////////////////////////////////
@@ -3294,8 +3296,16 @@ void pxScriptView::runScript()
32943296

32953297
// JRJR TODO initially with zero mWidth/mHeight until onSize event
32963298
// defer to onSize once events have been ironed out
3299+
int width = 1280;
3300+
int height = 720;
3301+
if (mUrl.find(0, "enableSparkGL1080") >= 0)
3302+
{
3303+
rtLogInfo("enabling 1080 SparkGL app");
3304+
width = 1920;
3305+
height = 1080;
3306+
}
32973307
mSharedContext->makeCurrent(true);
3298-
cached = context.createFramebuffer(1280,720,false,false,true);
3308+
cached = context.createFramebuffer(width,height,false,false,true);
32993309
mSharedContext->makeCurrent(false);
33003310

33013311
beginDrawing();

0 commit comments

Comments
 (0)