Click here to Skip to main content
15,895,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: basic gaming in c++ Pin
Richard MacCutchan18-Jun-12 21:14
mveRichard MacCutchan18-Jun-12 21:14 
AnswerRe: basic gaming in c++ Pin
Maximilien19-Jun-12 0:55
Maximilien19-Jun-12 0:55 
GeneralRe: basic gaming in c++ Pin
JackDingler19-Jun-12 10:05
JackDingler19-Jun-12 10:05 
AnswerRe: basic gaming in c++ Pin
Sivaraman Dhamodharan19-Jun-12 22:47
Sivaraman Dhamodharan19-Jun-12 22:47 
Questionhow to make a line in c++ Pin
Member 913892418-Jun-12 18:03
Member 913892418-Jun-12 18:03 
AnswerRe: how to make a line in c++ Pin
enhzflep18-Jun-12 18:50
enhzflep18-Jun-12 18:50 
GeneralRe: how to make a line in c++ Pin
Member 913892419-Jun-12 0:43
Member 913892419-Jun-12 0:43 
GeneralRe: how to make a line in c++ Pin
enhzflep19-Jun-12 0:52
enhzflep19-Jun-12 0:52 
Could you be more specific please?

I'm not using sound, nor is the line drawn using Vegemite-sandwiches!

The line is drawn using pixels and (obviously) graphics!


If you'd like to use graphics.h (Are you using TurboC?) and would like to calculate the position of the individual pixels themselves, you should look up lineDDA or Bresenham or if you'd like it anti-aliased, the Wu Anti-Aliasing algorithm.

There's a million examples already out there. As a programmer, one of your fundamental skills (and tasks) is that of researching!

Go on, have a look it's not that hard. - If you want to code the line function yourself, you should be prepared to read some older code, since for the most part this is a problem that is solved using pre-existing functions, like the ones I linked you to. Functions that will work anywhere, regardless of the BitDepth or resolution of the display monitor. They are also optimized, that is to say they DO-NOT call Pixel(x,y,col) for each point in the line - they'll be a squillion times faster than anything you write yourself - many will also be seamlessly hardware-accelerated.

Smile | :)
QuestionRe: how to make a line in c++ Pin
Member 913892419-Jun-12 17:45
Member 913892419-Jun-12 17:45 
AnswerMessage Removed Pin
19-Jun-12 17:49
enhzflep19-Jun-12 17:49 
GeneralRe: how to make a line in c++ Pin
Member 913892419-Jun-12 17:56
Member 913892419-Jun-12 17:56 
GeneralRe: how to make a line in c++ Pin
enhzflep19-Jun-12 18:00
enhzflep19-Jun-12 18:00 
GeneralRe: how to make a line in c++ Pin
enhzflep19-Jun-12 18:24
enhzflep19-Jun-12 18:24 
AnswerRe: how to make a line in c++ Pin
enhzflep19-Jun-12 17:50
enhzflep19-Jun-12 17:50 
AnswerRe: how to make a line in c++ Pin
Albert Holguin19-Jun-12 2:33
professionalAlbert Holguin19-Jun-12 2:33 
QuestionCompiler Question: Use of MFC : Use Standard Windows Libraries Pin
DeepT18-Jun-12 10:57
DeepT18-Jun-12 10:57 
AnswerRe: Compiler Question: Use of MFC : Use Standard Windows Libraries Pin
Binu MD18-Jun-12 14:29
Binu MD18-Jun-12 14:29 
GeneralRe: Compiler Question: Use of MFC : Use Standard Windows Libraries Pin
DeepT19-Jun-12 2:24
DeepT19-Jun-12 2:24 
GeneralRe: Compiler Question: Use of MFC : Use Standard Windows Libraries Pin
Richard MacCutchan19-Jun-12 3:10
mveRichard MacCutchan19-Jun-12 3:10 
GeneralRe: Compiler Question: Use of MFC : Use Standard Windows Libraries Pin
DeepT19-Jun-12 3:24
DeepT19-Jun-12 3:24 
GeneralRe: Compiler Question: Use of MFC : Use Standard Windows Libraries Pin
Richard MacCutchan19-Jun-12 4:14
mveRichard MacCutchan19-Jun-12 4:14 
GeneralRe: Compiler Question: Use of MFC : Use Standard Windows Libraries Pin
DeepT19-Jun-12 4:20
DeepT19-Jun-12 4:20 
GeneralRe: Compiler Question: Use of MFC : Use Standard Windows Libraries Pin
Richard MacCutchan19-Jun-12 4:32
mveRichard MacCutchan19-Jun-12 4:32 
QuestionDebugger issue Pin
Julio Cesar Nardelli Borges18-Jun-12 8:53
Julio Cesar Nardelli Borges18-Jun-12 8:53 
AnswerRe: Debugger issue Pin
Richard MacCutchan18-Jun-12 9:03
mveRichard MacCutchan18-Jun-12 9:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.