Any programmers out there?

Discussion in 'Technology Talk' started by KimberVaile, Sep 23, 2017.

  1. Eleven-lyc

    Eleven-lyc Elder Werewolf

    Aye, I'm largely the same; most of what I know comes from books, API documentation, and my own experiments.
    Yeah, you'll need a graphics library for that! Something that'll give an API for drawing stuff. I haven't used DirectX or OpenGL, but I can recommend SDL for starting out; Simple DirectMedia Layer. It's probably quite old now, but there's plenty of quite good tutorial material for it on the web.
    Aww, don't let it put you off! It took me quite a while to really “get” C/C++, and I can pick up languages pretty quickly. One thing I've noticed books and such on the subject often miss is the difference between C/C++ and other languages, such as Java, C#, Python, e.t.c.. Many languages come with a supporting platform of some sort; with Java it's the extensive Java API and the Java Virtual Machine runtime; with C# it's the extensive .NET API and Common Language Runtime… But with C/C++, there's essentially no supporting platform, no well-defined runtime. It's almost entirely up to the programmer to link in with supporting APIs, and build the program for each environment in which it should run (Windows 7 / XP / Linux Ubuntu, 32-bit/64-bit, e.t.c.), the sorts of things that a runtime usually takes care of. I suppose you could say C/C++ is a bit like SQL — just a language specification. Also, with SQL, each database engine provides its own implementation of the language; with C/C++, each operating system provides its own implementation (by my understanding, at least).
    It'll be hard, but hopefully very interesting! You'll get to see some of the technicalities that Java's been hiding from you.

    Also, Telnac, question for you! It's something that I've always wondered about, regarding graphics libraries and how they fit into Windows… By my understanding, Windows exposes access to the video hardware to user-mode via GDI, GDI being implemented in kernel-mode. But I've also heard GDI being described as “old” and “inefficient”, and DirectX almost being described as a “replacement”. Yet by my understanding, DirectX is simply another user-mode graphics API, alongside the likes of OpenGL and SDL, all of which would have to call into the kernel-mode GDI API to access the video hardware. Do you know if there's something I'm missing? Is there another kernel API besides GDI hidden away somewhere, which provides access to the video hardware? Or is perhaps the term GDI ambiguous, referring to one of two different things, a kernel-mode API and a user-mode API, with graphics libraries like DirectX simply replacing user-mode GDI?
    It's something I've been wondering for almost as long as what the “//” at the start of the scheme-specific-part of URLs denoted, another great mystery that was finally uncovered not so long ago.
  2. Telnac

    Telnac Fundamentalist Heretic

    That's a great question. I thought it bypassed the GDI since GDI was built back when 2D graphics was the norm, but I wasn't sure so I had to look it up. It turns out that yes, that's exactly what it does. Starting with XP, there was a 3D standard (XPDM) that graphics cards could support. However, the details of exactly how they supported it varied wildly from card developer to card developer and that led to many compatibility issues. Starting with Windows Vista, Microsoft and 3D graphics display developers agreed on a new set of standards (WDDM), which were built into the hardware of 3D graphics and the kernel, but that standard initially did away with GDI entirely which drew the ire of developers who didn't want to be forced down the path of Direct2D or OpenGL for rendering in 2D. That was addressed starting with Windows 7 when the functionality of GDI returned with the new standard of DXGI. For 3D, both OpenGL and DirectX call the newest version of WDDM, which gives them the freedom to handle the low-level implementation of things such as memory allocation as they see fit. So I suppose someone with a lot of time on their hands could implement a 3D graphics pipeline that rivals OpenGL or DirectX, but I'd rather just go with one or the other.
  3. Eleven-lyc

    Eleven-lyc Elder Werewolf

    Ahh, so WDDM essentially replaces GDI as the kernel-level API for video hardware? Or rather, XPDM replaced GDI, and WDDM replaced XPDM. Interesting… Well, I learnt something new today! Makes sense that I didn't know, though; most of my books are from the late Windows XP era or earlier, back when GDI was still around, and it seems Windows was still trying to iron out a decent replacement for the GDI interface at that time.
  4. Telnac

    Telnac Fundamentalist Heretic

    Yeah, I remember video card compatibility was a huge issue in the late 90s. Nothing gave you the dreaded blue screen of death father than trying to run a game not compatible with your card! XPDM helped, but it still took many years before it all got ironed out.
    -..Legacy..- likes this.
  5. Redwulf16

    Redwulf16 New Member

    I'm in high school now but I want to program when I grow up. I've written a few websites in html and I did a cool matrix rain effect in a windows batch file.
    I tried to program in java but it wouldn't let me save to my program files. Said I needed admin permission even though I'm the admin for my computer.
    My guess is that my antivirus software was blocking it somehow.

Share This Page