Neither one nor Many
Software engineering blog about my projects, geometry, visualization and music.
I have posted on using allegro 4 with wxWidgets before. Allegro 5 is more easy.
Just the stuff I encountered and how to fix
#define ALLEGRO_USE_CONSOLE 1
Avoids the following error.
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
#define ALLEGRO_USE_CONSOLE 1
#include <allegro5/allegro.h>
#include <allegro5/allegro_image.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
Note that there is no equivalent of Allegro 4's draw_to_hdc() function. With a little grepping in the source code I found out that (for windows anyway) you have functions that do the same in C:\allegro5\src\win\wmcursor.c
Just borrow local_draw_to_hdc from there and use it in the paint event.
staticbitmap->Connect(wxID_STATIC, wxEVT_PAINT, wxPaintEventHandler(SharedMemoryTest::OnPaint), NULL, this);
void SharedMemoryTest::OnPaint( wxPaintEvent& event )
{
wxPaintDC dc(wxDynamicCast(event.GetEventObject(), wxWindow));
WXHDC wxHDC = wxPaintDC::FindDCInCache((wxWindow*) event.GetEventObject());
HDC hDC = (HDC) wxHDC;
local_draw_to_hdc(hDC, bmp, 0, 0);
}