Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Allegro Beginner questions

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
Allegro Beginner questions
LennyLen
Member #5,313
December 2004
avatar

The result I got could have been due to my multi monitor setup. I'll try later with only a single monitor.

pkrcel
Member #14,001
February 2012

I've rebuilt your program from your last 7-zip with a fully static monolith Allegro in MSYS2, this is what I get on a test 800x600

Care that the Allegro lib is a Debug build (not optimized), my specs on the Laptop are:

Intel core i3-2330M @ 2.2GHz, 4GB RAM, Intel HD graphics 3000 (Opengl 3.1 context max).

$ ./Bitmaplocking
Starting BitmapLocking in 800 X 600 windowed default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 4.094687
FPS : 244.218891

$ ./Bitmaplocking 800 600 opengl
Starting BitmapLocking in 800 X 600 windowed opengl with numframes = 1000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 39.137457
FPS : 25.550970

A very noticeable difference indeed.

EDIT: I should add that running fullscreen in d3d mode is fast but i can't get the specs since the program does not print those out.

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

LennyLen
Member #5,313
December 2004
avatar

So it turns out that it was running multiple monitors that was causing the program to not run properly. Once I'd disabled all but my main monitor I got the following results:

C:\Users\LennyLen\Desktop\bl>BitmapLocking.exe 1280 720 fullscreen 10000
Starting BitmapLocking in 1280 X 720 fullscreen default with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 15.039495
FPS : 664.915961

C:\Users\LennyLen\Desktop\bl>BitmapLocking.exe 1280 720 fullscreen opengl 10000
Starting BitmapLocking in 1280 X 720 fullscreen opengl with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 27.325060
FPS : 365.964428

pkrcel
Member #14,001
February 2012

I've tried it on my home lappy, which is a bit beefier and has two GPUs.

Specs are:
Interl core i7-2670QM @ 2.20GHz, 4GB RAM,

Running with the NVIDIA GeForce 610M (own 2GB mem, opengl context 4.3)

Starting BitmapLocking in 800 X 600 windowed default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 1.448427
FPS : 690.404023

Starting BitmapLocking in 800 X 600 windowed opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 16.744071
FPS : 59.722633

There's STILL a 10x difference in speed...:-/

and with the integrated Intel HD3000 (Opengl context 3.1)

Starting BitmapLocking in 800 X 600 windowed default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 2.322496
FPS : 430.571225

Starting BitmapLocking in 800 X 600 windowed opengl with numframes = 1000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 30.003446
FPS : 33.329505

That's a big difference also on this "better" platform with the NVIDIA GPU.

I dare say TOO MUCH of a difference, if ony profiling on windows would prove to be a bit goddamn easier...>:(

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Thomas Fjellstrom
Member #476
June 2000
avatar

There is clearly something up with windows's opengl, and our gl code. Some of these tests were probably using MS's opengl... but still the numbers over all are not great.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

pkrcel
Member #14,001
February 2012

I've updated the GFX drivers for the NVIDIA GPU and...weird enuff...fullscreen opengl is now MUCH faster that D3D...and D3D looks awful with some translucent black bars (surely artifacts) popping up. :P

Starting BitmapLocking in 800 X 600 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 10.543454
FPS : 94.845576

Starting BitmapLocking in 800 X 600 fullscreen opengl with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 3.076167
FPS : 325.079932

Something's fishy here :P

Coounterwise...on the Intel HD3000


D:_user\Pkrcel\coding\BitmapLocking>BitmapLocking.exe 800 600 fullscreen
Starting BitmapLocking in 800 X 600 fullscreen default with numframes = 1000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 0.481809
FPS : 2075.510044

D:_user\Pkrcel\coding\BitmapLocking>BitmapLocking.exe 800 600 fullscreen opengl

Starting BitmapLocking in 800 X 600 fullscreen opengl with numframes = 1000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 28.388358
FPS : 35.225707

:o :o :o the D3D code runs....I dare say EXTREMELY fast and OpenGL is an awful slog.

I wonder how much is Allegro's "fault" and how dang much is about drivers...

EDIT: by the way it should be noticed that I didn't touch Intel's drivers so I wonder WHAT coudl cause the speed up.

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Thomas Fjellstrom
Member #476
June 2000
avatar

Some weird opengl conflict with dual gpu setups is my assumption...

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Neil Roy
Member #2,229
April 2002
avatar

Some weird opengl conflict with dual gpu setups is my assumption...

I only have one GPU, one monitor etc and it is very slow for me.

Thomas Fjellstrom
Member #476
June 2000
avatar

NiteHackr said:

I only have one GPU, one monitor etc and it is very slow for me.

Well that was for the other report... But yeah, some opengl issue here.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

GullRaDriel
Member #3,861
September 2003
avatar

In fact I have a combo of intel hd 3000 and ati 7800.

C:\Users\Gull\Downloads\BitmapLocking>BitmapLocking.exe 320 200 10000
Starting BitmapLocking in 320 X 200 windowed default with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 4.317373
FPS : 2316.223166

C:\Users\Gull\Downloads\BitmapLocking>BitmapLocking.exe 320 200 opengl 10000
Starting BitmapLocking in 320 X 200 windowed opengl with numframes = 10000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 2.864330
FPS : 3491.217494

C:\Users\Gull\Downloads\BitmapLocking>BitmapLocking.exe 1280 720 10000
Starting BitmapLocking in 1280 X 720 windowed default with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 45.392228
FPS : 220.302032

C:\Users\Gull\Downloads\BitmapLocking>BitmapLocking.exe 1280 720 10000 fullscreen
Starting BitmapLocking in 1280 X 720 fullscreen default with numframes = 10000
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 25.590492
FPS : 390.770130

C:\Users\Gull\Downloads\BitmapLocking>BitmapLocking.exe 1280 720 opengl 10000
Starting BitmapLocking in 1280 X 720 windowed opengl with numframes = 10000
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 41.325782
FPS : 241.979693

THE LAST THREE ARE NOT WORKING:

C:\Users\Gull\Downloads\BitmapLocking>BitmapLocking.exe 1280 720 opengl 10000 fullscreen
Starting BitmapLocking in 1280 X 720 windowed opengl with numframes = 0
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 0.049416
FPS : 20.236557

C:\Users\Gull\Downloads\BitmapLocking>BitmapLocking.exe 1280 720 10000 fullscreen opengl
Starting BitmapLocking in 1280 X 720 windowed default with numframes = 0
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 0.024095
FPS : 41.503173

C:\Users\Gull\Downloads\BitmapLocking>BitmapLocking.exe 1280 720 10000 fullscreen opengl
Starting BitmapLocking in 1280 X 720 windowed default with numframes = 0
Pixel format of screen : 23
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 0.021616
FPS : 46.263087

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Edgar Reynaldo
Member #8,592
May 2007
avatar

Quote:

THE LAST THREE ARE NOT WORKING:

There was a bug in the code. You should be able to use anything for the 6th parameter now - before it was trying to atoi("fullscreen") or atoi("opengl") for the num of frames.


c:\ctwoplus\progcode\allegro5\test\BitmapLocking>BitmapLocking.exe 800 600 500 fullscreen opengl
Starting BitmapLocking in 800 X 600 fullscreen opengl with numframes = 500
Pixel format of screen : 9
ALLEGRO_PIXEL_FORMAT_ARGB_8888 - 32 bit : 9
ALLEGRO_PIXEL_FORMAT_RGBA_8888 - 32 bit : 10
ALLEGRO_PIXEL_FORMAT_ABGR_8888 - 32 bit : 17
ALLEGRO_PIXEL_FORMAT_XBGR_8888 - 32 bit : 18
ALLEGRO_PIXEL_FORMAT_RGBX_8888 - 32 bit : 22
ALLEGRO_PIXEL_FORMAT_XRGB_8888 - 32 bit : 23
Total time taken : 36.720223
FPS : 13.616475

c:\ctwoplus\progcode\allegro5\test\BitmapLocking>

I attached a new 7z archive

 1   2   3 


Go to: