Evgeniy Ivanov wroteI'm doing sdlgraph - so I put my self to packages/base/graph.
graph probably has to be moved to packages/extra, so it can easily use things like sdl and the (Mac OS X) universal interfaces.
Show quoted text 6 lines
I can't understand the method (where are they used?) using routines in
TModeInfo (from graphh.inc).
In custom graph modules it's used in such way:
mode.PutPixel:={$ifdef ;
But in windows and go32v2 there are no any routines for PutPixel from
interface.
They don't need to be in the interface. PutPixel is a procedure variable, and the only thing that needs to be in the interface (and it's declared in graphh.inc, which is included in the interface of the go32v2 and win32 unts). The procedures which are assigned to this procvar do not have to be in the interface.
Show quoted text 17 lines
I mean someting like
PutPixel := @custom_PutPixel; (PutPixel :=
@libvga_PutPixelProc; - in the unix graph.pp).
So, if there are no such assignations (sorry, I don't know the
right word)
PutPixelDefault from graph.inc will be used...
And it is:
procedure PutPixelDefault(X,Y: smallint; Color: Word);
begin
Writeln(stderr,'Error: Not in graphics mode (use InitGraph and
test
GraphResult afterwards)');
Halt(1);
end;
But windows module works...
Have a look at QueryAdapterInfo in graph.pp of go32v2. It has many blocks like this:
InitMode(mode);
{ now add all standard VGA modes... }
mode.DriverNumber:= LowRes;
mode.HardwarePages:= 0;
mode.ModeNumber:=0;
mode.ModeName:='320 x 200 VGA';
mode.MaxColor := 256;
mode.PaletteSize := mode.MaxColor;
mode.DirectColor := FALSE;
mode.MaxX := 319;
mode.MaxY := 199;
mode.DirectPutPixel:={$ifdef ;
mode.PutPixel:={$ifdef ;
mode.GetPixel:={$ifdef ;
mode.SetRGBPalette := {$ifdef ;
mode.GetRGBPalette := {$ifdef ;
mode.SetAllPalette := {$ifdef
SetVGARGBAllPalette;
mode.SetVisualPage := {$ifdef ;
mode.SetActivePage := {$ifdef ;
mode.InitMode := {$ifdef ;
mode.XAspect := 10000;
mode.YAspect := 10000;
AddMode(mode);
When switching to a mode, initgraph will assign the putpixel field of that mode to the global putpixel procvar.
Jonas