i once said i was coding some library for win32
that grants acces to making easy (old school in spirit)
per pixel graphics apps in windows (win32)
i was quite not touched it for 2 years or so but its functional and i am quite pleased by that lib though it is
not polished and even in design state as o some elements
you may check some example how to use it
minddetonator.htw.pl/gfe.zip
you need windows and mngw installed and thats all
here i showed how with few lines of code you cold create a windows and make something like small raw paint
appplication
this code is
#include<windows.h>
#include "green-fire.h"
int background_color = 0x00400020;
int drawing_color = 0xffffff;
int pen_size = 5;
void RunFrame(int no_advance)
{
if(frame_number==0)
ClearFrameData(background_color);
if(lmb_pressed)
FillCircle( mouse_x, mouse_y, pen_size, drawing_color);
if(rmb_pressed)
FillCircle( mouse_x, mouse_y, pen_size, background_color);
}
void ProcessMouseMove(int x, int y)
{
}
void ProcessKeyDown(int key)
{
if(key=='1') drawing_color = 0x00ffffff;
if(key=='2') drawing_color = 0x00551188;
if(key=='3') drawing_color = 0x00115088;
if(key=='4') drawing_color = 0x0015e078;
if(key=='5') drawing_color = 0x00256048;
if(key=='6') drawing_color = 0x00358098;
if(key=='7') drawing_color = 0x00e5c098;
if(key=='8') drawing_color = 0x003530a8;
if(key=='9') drawing_color = 0x0085c0f8;
if(key==VK_SPACE)
SaveFrameAsBMP("saved.bmp");
}
void OnResize()
{
RunFrame(1);
}
int main(void)
{
SetupWindow(" fir's Green fire usage example ", "2D", "notrace", 515, 415, 30, 20, RunFrame, 9, OnResize, ProcessMouseMove, ProcessKeyDown);
return 0;
}
separate topic is in fact i could and should to redesign it a bit (removing windows.h dependency (which is slight and probably not needed) and redesign the callbacks maybe for better usage
my goal (which probably fail as i know life though its good imo) would be to interest some people here to write some per pixel snippets and make some fun of it , mayb some contests and discussion (the contexts and discusion based on console are boring and my ap makes coding per pixel c snippeds real easy and potential fun is quite big)