Pages

Monday, 16 March 2020

Chapter 12 // Exercise 1 - Principles & Practice Using C++

In this exercise I am using Visual Studio 2017 and the graphics files found here:
https://github.com/l-paz91/principles-practice/tree/master/Graphics%20Files

Chapter 12 // Exercise 1

Draw a rectangle as a Rectangle and as a Polygon. Make the lines of the Polygon red and the lines of the Rectangle blue.

Github: https://github.com/l-paz91/principles-practice/blob/master/Chapter%2012/Exercise%201

It's weird to think that tediously defining each line of a polgon was the standard in games programming 25 years ago.



6 comments:

  1. thanks for the prep u gave for this chapter , like sorting those messed up files...
    okay here we are using Simple_window win{ tl,600,400,"Canvas" }; to create a window and than
    creating an axis -> Axis xa{ Axis::x,Point{20,300},280,10,"x axis" }; assigning it to the window - win.attach(xa);
    the thing is i would like to draw this axis on an already created window (not created using this fltk),
    is there a way to do it!!
    i have a handle to that window.

    ReplyDelete
    Replies
    1. I'm not sure I understand? An axis is a class made by Bjarne using fltk, it can only be attached to fltk windows. If you have created a window using a different API (like DirectX or sfml), then you would need to use that API to draw things on the window.

      Delete
    2. thanks that's what i exactly wanted to know... i have started Dx11 from scratch.

      Delete
    3. ah I see. Good luck! I hate Dx11 lol. I prefer using 9 but it's old.

      Delete
    4. actually i have no knowledge of dx9 , i have nt even finished chapter 12 this fltk thing, but i wanted to move to graphics fast , so i searched for which to learn , ie. opengl,dx9,11 , and i went with dx11. Is it fine to do so? or i am taking more than a step at a time. my basics of c++ are pretty clear.

      Delete
    5. It really depends on what you want to do! What's your goal? Are you more interesting in making games or creating the engine? Do you prefer rendering or optimisations?

      Delete