Thread: C++ Graphic functions

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    361

    C++ Graphic functions

    I have been searching the internet for tutorials on how to make your own graphic functions, like writing pixels, displaying sprites and so on. Does anyone here know where to find a tutorial for that?

  2. #2
    In The Light
    Join Date
    Oct 2001
    Posts
    598
    howdy,
    try searching for
    opengl

    M.R.
    I don't like you very much. Please post a lot less.
    Cheez
    *and then*
    No, I know you were joking. My point still stands.

  3. #3
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    OpenGL just uses the hardware drivers of whatever video GPU you have, I think he meant he was trying to find ways to write his own instead of using any pre existing specification.

  4. #4
    Registered User
    Join Date
    Jan 2003
    Posts
    361
    Yes, I do mean to write my own functions, not use pre-existing ones.

  5. #5
    Registered User Cela's Avatar
    Join Date
    Jan 2003
    Posts
    362
    >>Yes, I do mean to write my own functions, not use pre-existing ones.
    That's really advanced and hardware specific, if I were going to do it I'd grab some Open-Source graphics library and look over the code real hard to get the gist of things. I can pretty much guarantee that you won't find a tutorial on it though.
    *Cela*

  6. #6
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    It all depends on how you define 'own made functions'.

    You could use a third-party API like Win32 and write your function
    on that.
    If you're still not satisfied with that i'd say use Assembly, but it'l
    be hard to entirely write your own draw function close to the
    hardware.

  7. #7
    I would use a 3rd party API to do this, such as DirectX or OpenGL.

  8. #8
    Registered User
    Join Date
    Jan 2003
    Posts
    361
    Can't I make the graphic functions in all C++? or do I need to use assembly?

  9. #9
    Registered User
    Join Date
    Sep 2002
    Posts
    272
    I'm not sure what you're trying to do, but it will probably depend on what you're doing it on. What hardware/os are you using?
    Joe

  10. #10
    Registered User
    Join Date
    Jan 2003
    Posts
    361
    I am using Win XP and a Geforce2. I am trying to create functions in C++ that I can draw pixels.

  11. #11
    Registered User
    Join Date
    Sep 2002
    Posts
    272
    Microsoft have already made one for you; but you'll need to know a bit about their API. Other than that you can use another API (OpenGL, DX, etc), get a dos compiler and write to video memory and hope the virtual machine copes, or write a device driver. Each of these would require a more in depth explanation. What sounds most appealing?
    Joe

  12. #12
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Originally posted by Glirk Dient
    Can't I make the graphic functions in all C++?
    rubish();
    Last edited by Travis Dane; 01-24-2003 at 05:32 PM.

  13. #13
    Registered User
    Join Date
    Sep 2002
    Posts
    272
    No, C++ is a high level language meaning that it utilizes other
    code to get things done, if you want to entirely write a function
    yourself you end up with assembly because thats the lowest
    possible language meaning you write almost ON the hardware.
    Rubbish.
    Joe

  14. #14
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Originally posted by JoeSixpack
    Rubbish.
    How about correcting me so whe can all learn hm?

  15. #15
    Registered User
    Join Date
    Sep 2002
    Posts
    272
    How about correcting me so whe can all learn hm?
    OK. It is possible to write to an arbitrary memory location using C++ (assuming your operating environment allows it). Therefore, you can theoretically write to the video memory. This does not need assembly, only sufficient privilege. Assembly (without some fancy tricks) isn't going to give you this. If you didn't have sufficient priviledge you'd probably have to write a device driver; not necessarily in assembly.

    Besides, all higher-level languages at some point will translate to assembly; does this mean you can't write anything in a high level language (the op wanted to write graphics functions in C++)?
    Joe

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 03:35 AM
  2. Factory Functions HOWTO
    By GuardianDevil in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2004, 01:41 PM
  3. Shell functions on Win XP
    By geek@02 in forum Windows Programming
    Replies: 6
    Last Post: 04-19-2004, 05:39 AM
  4. Inline functions and inheritance
    By hpy_gilmore8 in forum C++ Programming
    Replies: 3
    Last Post: 01-14-2004, 06:46 PM
  5. functions - please help!!!!
    By linkies in forum C Programming
    Replies: 1
    Last Post: 08-21-2002, 07:53 AM