-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class Main | ||
{ | ||
public static function main() | ||
{ | ||
var args = nme.system.System.getArgs(); | ||
if (args.length!=1) | ||
{ | ||
Sys.println("Usage: Application name.jpg"); | ||
Sys.println(" or : nme cpp -args name.jpg"); | ||
return; | ||
} | ||
|
||
var name = args[0]; | ||
var bmp = nme.display.BitmapData.load(name); | ||
trace('Loaded $bmp'); | ||
|
||
var bytes = nme.utils.ByteArray.readFile(name); | ||
trace("Found " + bytes.length + " bytes"); | ||
|
||
trace("Timing..."); | ||
var t0 = haxe.Timer.stamp(); | ||
for(i in 0...100) | ||
{ | ||
var bmp = nme.display.BitmapData.loadFromBytes(bytes); | ||
bmp.dispose(); | ||
} | ||
var t1 = haxe.Timer.stamp(); | ||
trace("Load time:" + (t1-t0)/100 + "s"); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<project> | ||
|
||
<meta | ||
title="NME Application" | ||
package="com.nmehost.jpgbench" | ||
version="1.0.0" | ||
company="nme" | ||
/> | ||
|
||
<app | ||
file="Application" | ||
main="Main" | ||
bootType="mainCommandLine" | ||
/> | ||
|
||
<window | ||
width="640" | ||
height="480" | ||
orientation="landscape" | ||
fps="60" | ||
background="0xeeeeee" | ||
require_shaders="true" | ||
resizable="true" | ||
hardware="true" | ||
/> | ||
|
||
<haxelib name="nme" /> | ||
|
||
</project> |