Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » LineDDA
LineDDA [message #4881] Thu, 24 August 2006 04:45 Go to next message
unknown user
Window has a function I think very useful,does Linux have one too?
following code comes from WINE:
============================================================ =====
BOOL WINAPI LineDDA(INT nXStart, INT nYStart, INT nXEnd, INT nYEnd,
LINEDDAPROC callback, LPARAM lParam )
{
INT xadd = 1, yadd = 1;
INT err,erradd;
INT cnt;
INT dx = nXEnd - nXStart;
INT dy = nYEnd - nYStart;

if (dx < 0) {
dx = -dx; xadd = -1;
}
if (dy < 0) {
dy = -dy; yadd = -1;
}
if (dx > dy) { /* line is "more horizontal" */
err = 2*dy - dx; erradd = 2*dy - 2*dx;
for(cnt = 0;cnt <= dx; cnt++) {
callback(nXStart,nYStart,lParam);
if (err > 0) {
nYStart += yadd;
err += erradd;
} else {
err += 2*dy;
}
nXStart += xadd;
}
} else { /* line is "more vertical" */
err = 2*dx - dy; erradd = 2*dx - 2*dy;
for(cnt = 0;cnt <= dy; cnt++) {
callback(nXStart,nYStart,lParam);
if (err > 0) {
nXStart += xadd;
err += erradd;
} else {
err += 2*dx;
}
nYStart += yadd;
}
}
return TRUE;
}
============================================================ ==
can U++ provide one?
Re: LineDDA [message #4893 is a reply to message #4881] Thu, 24 August 2006 16:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13995
Registered: November 2005
Ultimate Member
I believe this is too specific to include...

Mirek
Re: LineDDA [message #4896 is a reply to message #4893] Thu, 24 August 2006 16:22 Go to previous message
unknown user
luzr wrote on Thu, 24 August 2006 10:07

I believe this is too specific to include...

Mirek

yes,it does.doesn't matter
Previous Topic: Using 605 in Linux several windows are not resizeable and don't fit in screen
Next Topic: Microsoft Visual C++ workspace
Goto Forum:
  


Current Time: Sun Jul 21 10:03:02 CEST 2024

Total time taken to generate the page: 0.02711 seconds