Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Draw to bitmap failing

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Draw to bitmap failing
Space cpp
Member #16,322
May 2016

My command line includes -lwinmm, so, yes.

----------
My games

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Space cpp
Member #16,322
May 2016

g++ -I"C:\allegro_edgar\include" -L"C:\allegro_edgar\lib" main.cpp -Wall -o bitmapbug -lallegro_monolith-debug-static -ljpeg -ldumb -lFLAC -lfreetype -lvorbisfile -lvorbis -logg -lphysfs -lpng16 -lzlibstatic -ldsound -lgdiplus -luuid -lkernel32 -lwinmm -lpsapi -lopengl32 -lglu32 -luser32 -lcomdlg32 -lgdi32 -lshell32 -lole32 -ladvapi32 -lws2_32 -lshlwapi -static-libstdc++ -static-libgcc

----------
My games

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Space cpp
Member #16,322
May 2016

Ok, attached it on the post.

----------
My games

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Space cpp
Member #16,322
May 2016

That's strange, adding -lpthread made no difference for me. Puting libpthread-1.dll on the same folder as the executable also didn't solved.

Do you know how to use gdb?

Sorry, never used it before.

----------
My games

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Then we're not running the same exe...???

You need to learn how to use gdb or at least some kind of debugger, if you're going to be a programmer.

See my little guide here :

https://github.com/liballeg/allegro_wiki/wiki/Debugging-and-logging-with-A5#debugging-with-gdb

When you link statically, it doesn't depend on any dlls, so something is wrong.

Are you sure you're running the right program?

Space cpp
Member #16,322
May 2016

Just checked it again, yes.
The command line:
g++ -I"C:\allegro_edgar\include" -L"C:\allegro_edgar\lib" -g main.cpp -Wall -o bitmapbug -lallegro_monolith-debug-static -ljpeg -ldumb -lFLAC -lfreetype -lvorbisfile -lvorbis -logg -lphysfs -lpng16 -lzlibstatic -ldsound -lgdiplus -luuid -lkernel32 -lwinmm -lpsapi -lopengl32 -lglu32 -luser32 -lcomdlg32 -lgdi32 -lshell32 -lole32 -ladvapi32 -lws2_32 -lshlwapi -lpthread -static-libstdc++ -static-libgcc

Compiled using mingw32.exe included in msys2 installation; include and lib paths set to your allegro build.

Is everything correct at this point?

Edit:
Oops, I forgot that gdb is THE debugger.

----------
My games

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Space cpp
Member #16,322
May 2016

Can you upload your exe for me to test if that bug still happens?

----------
My games

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Space cpp
Member #16,322
May 2016

Yes, no text appears, just the orange screen.

----------
My games

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Space cpp
Member #16,322
May 2016

But the actual video image, does it get created successfully or no?

The "atlas_texture" is created (no error message is shown, also, not a memory bitmap) but no text is drawn to it.

There must be some font corruption

It doesn't look like to be a font issue since al_draw_bitmap calls also don't work.

Regarding the orange screen, that's what I get when I render with OpenGL

My machine does the opposite: rendering in OpenGL eliminates the bug.

----------
My games

 1   2 


Go to: