Thanks, Jonas. I will deep inside it.<br><br><div><span class="gmail_quote">2007/7/16, Jonas Maebe <<a href="mailto:jonas.maebe@elis.ugent.be">jonas.maebe@elis.ugent.be</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On 14 Jul 2007, at 16:01, Evgeniy Ivanov wrote:<br><br>> I'm doing sdlgraph - so I put my self to packages/base/graph.<br><br>graph probably has to be moved to packages/extra, so it can easily<br>use things like sdl and the (Mac OS X) universal interfaces.
<br><br>> I can't understand the method (where are they used?) using routines in<br>> TModeInfo (from graphh.inc).<br>> In custom graph modules it's used in such way:<br>> mode.PutPixel:={$ifdef
fpc}@{$endif}PutPixVESA32kOr64k;<br>> But in windows and go32v2 there are no any routines for PutPixel from<br>> interface.<br><br>They don't need to be in the interface. PutPixel is a procedure<br>variable, and the only thing that needs to be in the interface (and
<br>it's declared in graphh.inc, which is included in the interface of<br>the go32v2 and win32 unts). The procedures which are assigned to this<br>procvar do not have to be in the interface.<br><br>> I mean someting like
<br>> PutPixel := @custom_PutPixel; (PutPixel :=<br>> @libvga_PutPixelProc; - in the unix graph.pp).<br>><br>> So, if there are no such assignations (sorry, I don't know the<br>> right word)
<br>> PutPixelDefault from graph.inc will be used...<br>> And it is:<br>> procedure PutPixelDefault(X,Y: smallint; Color: Word);<br>> begin<br>> Writeln(stderr,'Error: Not in graphics mode (use InitGraph and
<br>> test<br>> GraphResult afterwards)');<br>> Halt(1);<br>> end;<br>><br>> But windows module works...<br><br>Have a look at QueryAdapterInfo in graph.pp of go32v2. It has many<br>blocks like this:
<br><br> InitMode(mode);<br> { now add all standard VGA modes... }<br> mode.DriverNumber:= LowRes;<br> mode.HardwarePages:= 0;<br> mode.ModeNumber:=0;<br> mode.ModeName:='320
x 200 VGA';<br> mode.MaxColor := 256;<br> mode.PaletteSize := mode.MaxColor;<br> mode.DirectColor := FALSE;<br> mode.MaxX := 319;<br> mode.MaxY := 199;<br> mode.DirectPutPixel:={$ifdef
fpc}@{$endif}DirectPutPixel320;<br>> mode.PutPixel:={$ifdef fpc}@{$endif}PutPixel320;<br> mode.GetPixel:={$ifdef fpc}@{$endif}GetPixel320;<br> mode.SetRGBPalette := {$ifdef fpc}@{$endif}SetVGARGBPalette;
<br> mode.GetRGBPalette := {$ifdef fpc}@{$endif}GetVGARGBPalette;<br> mode.SetAllPalette := {$ifdef fpc}@{$endif}<br>SetVGARGBAllPalette;<br> mode.SetVisualPage := {$ifdef fpc}@{$endif}SetVisual320;
<br> mode.SetActivePage := {$ifdef fpc}@{$endif}SetActive320;<br> mode.InitMode := {$ifdef fpc}@{$endif}Init320;<br> mode.XAspect := 10000;<br> mode.YAspect := 10000;<br> AddMode(mode);
<br><br>When switching to a mode, initgraph will assign the putpixel field of<br>that mode to the global putpixel procvar.<br><br><br>Jonas<br>_______________________________________________<br>fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">
fpc-devel@lists.freepascal.org</a><br><a href="http://lists.freepascal.org/mailman/listinfo/fpc-devel">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a><br></blockquote></div><br><br clear="all"><br>-- <br>E.I.