Setting up OpenGL and Creating a Window in C++

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 มี.ค. 2024
  • Patreon ► / thecherno
    Twitter ► / thecherno
    Instagram ► / thecherno
    Discord ► thecherno.com/discord
    Series Playlist ► thecherno.com/opengl
    GLFW ► www.glfw.org/
    Thank you to the following Patreon supporters:
    - Samuel Egger
    - Dominic Pace
    Gear I use:
    -----------------
    BEST laptop for programming! ► geni.us/pakTES
    My FAVOURITE keyboard for programming! ► geni.us/zNhB
    FAVOURITE monitors for programming! ► geni.us/Ig6KBq
    MAIN Camera ► geni.us/t6xyDRO
    MAIN Lens ► geni.us/xGoDWT
    Second Camera ► geni.us/CYUQ
    Microphone ► geni.us/wqO6g7K

ความคิดเห็น • 854

  • @ProgrammerSheep
    @ProgrammerSheep 5 ปีที่แล้ว +695

    Never have I been so excited to draw a triangle.

    • @pradeepalhan
      @pradeepalhan 3 ปีที่แล้ว +7

      likewise !!

    • @xrafter
      @xrafter 3 ปีที่แล้ว +4

      @@pradeepalhan
      Wha is opengl

    • @xrafter
      @xrafter 3 ปีที่แล้ว +2

      @A42426 Ashley GILL
      What is the libraries?
      Is this something you can compile

    • @dreamingwarlord6151
      @dreamingwarlord6151 3 ปีที่แล้ว +1

      ​@@xrafter Open Graphics Library, pretty low level.

    • @asukalangleysoryu6695
      @asukalangleysoryu6695 3 ปีที่แล้ว +14

      @@xrafter Uhh maybe this video isn't for you...

  • @Redheadtama1
    @Redheadtama1 2 ปีที่แล้ว +385

    Note for anyone following this tutorial in Visual Studio 2022, after making the configuration changes to the include and lib directories, if you still have compiler errors and red squigglies, make sure the active platform is x86 (at the top of the main window, to the left of the "Local Windows Debugger" button, click the dropdown to switch from x64 to x86. Now if you reopen the configuration properties window, you should see the Platform dropdown says "Active(Win32)" and your changes should take effect.

    • @nixlittle5468
      @nixlittle5468 2 ปีที่แล้ว +29

      holly cow ! you come straight out of heaven !
      I've been litteraly sitting here for 2 hours freaking out and then you show up and just solve the issue with one click

    • @4tehath
      @4tehath 2 ปีที่แล้ว +1

      @@nixlittle5468 samesies man thank god i saw this comment. what an angel!

    • @carlsims1506
      @carlsims1506 2 ปีที่แล้ว

      You absolute gem! Thank you!

    • @TheArrowedKnee
      @TheArrowedKnee ปีที่แล้ว +1

      It still worked fine for me with x64

    • @lockks
      @lockks ปีที่แล้ว

      ty bro

  • @xaesthetics1769
    @xaesthetics1769 3 ปีที่แล้ว +272

    Him: "Idk why those libraries are linked.."*deletes*
    Compiler: (INSERT 100 ERRORS..)

    • @Drqonic
      @Drqonic 3 ปีที่แล้ว +15

      I personally never delete the dependencies my linker gives me by default. They're there for a reason, no touching.

    • @checkbordspy4608
      @checkbordspy4608 3 ปีที่แล้ว +5

      @@Drqonic i touched the dependencies in the linker....never, never again

    • @Drqonic
      @Drqonic 3 ปีที่แล้ว +2

      @@checkbordspy4608 exactly xD

    • @mattr2238
      @mattr2238 3 ปีที่แล้ว +1

      objdump -x is very useful in troubleshooting dependencies.
      I debug with objdump -d and gdb.

    • @generichuman_
      @generichuman_ 2 ปีที่แล้ว +1

      But he did it on purpose to show us...lol

  • @Mariuho1999
    @Mariuho1999 4 ปีที่แล้ว +802

    How i downloaded GLFW 3 times:
    Cherno: "So we need to download GLFW"
    me: *hits that download button*
    Cherno: "We could down... blah blah blah... But we're gonna download binaries"
    me: "Oh" *hits 64 bit binaries for windows download*
    Cherno: *So we are going to download 32bit binaries, we don't need 64 bit"
    ...
    Yeah

    • @potpindakaas3003
      @potpindakaas3003 4 ปีที่แล้ว +31

      I had exactly the the same situation haha

    • @coder2k
      @coder2k 4 ปีที่แล้ว +6

      same :D

    • @mrifat13
      @mrifat13 4 ปีที่แล้ว +3

      ahahahah i just imagine that while looking at the web 🤣

    • @gunger7670
      @gunger7670 4 ปีที่แล้ว +1

      I though I was the only one doing this lol

    • @xeliani.7809
      @xeliani.7809 4 ปีที่แล้ว +3

      64 bit would of worked fine tho but rip :P

  • @Poneglyph
    @Poneglyph 4 ปีที่แล้ว +62

    I can't believe this guy got me to do anything in opengl without using someone else's build entirely. Getting openGL running is the single biggest obstacle holding back people from learning computer graphics basics.

    • @user-xi1fe1jr6p
      @user-xi1fe1jr6p ปีที่แล้ว

      yeah, the setting up is not easy for beginners

  • @loryon
    @loryon 6 ปีที่แล้ว +623

    Why does so many people sucks at explaining the basics ? Cherno is just perfect !

    • @KimTiger777
      @KimTiger777 6 ปีที่แล้ว +39

      Perhaps because they them self forgot how it was they had to learn it. In my home country we have a saying: "The cow has forgotten that they once them self was a calf"
      Just a thought :P

    • @LoxagosSnake
      @LoxagosSnake 6 ปีที่แล้ว +16

      Because this guy is an industry professional (EA Games) and most others are not. Even a great developer making a tutorial that hasn't been exposed to the formalities and practices of professional software engineering won't have had as much practice. Programming really is a matter of exposure.

    • @cpuwrite
      @cpuwrite 5 ปีที่แล้ว +9

      RPMedia, I have written computer programs, manuals and fiction, and edited novels for publishing houses, so I've got a little bit of experience in this arena.
      One of the things you have to be careful with when checking out a novel is that the author isn't too close to the story. Remember: more than anyone who reads the story, the writer lives in its world. Some things may seem so obvious that they're not worth mentioning. That's one of the places where an editor comes in.
      The same holds true for a tutorial. Sometimes, some tips and tricks are so ingrained into the tutor that they just go without saying. Here is where a reviewer earns his or her (paltry) pay.
      What Cherno does that makes him so good is to take you right through the process, from a first-person point of view. He's also obviously been doing this for a while, so he knows what he's doing, but, more importantly, since he takes you through the actual process, the problems he has are going to be the problems he has.
      Also, Cherno just plain has a knack for it. Some do.

    • @jakubpruher979
      @jakubpruher979 5 ปีที่แล้ว +6

      Generally spaeaking, people suck at explaining things because they just regurgitate what they have been told and have never internalized the knowledge by meditating on the subject. I see this all the time and it's driving me fucking crazy!

    • @bonbonpony
      @bonbonpony 4 ปีที่แล้ว +3

      So what exactly did he explain in this video, besides the things every C++ programmer should know already BEFORE getting into OpenGL programming? (or any APIs whatsoever)
      He didn't explain a single line of the code he used, he just copy-pasted the code from the documentation, added a bunch of other function calls he didn't explain either, and that's pretty much it :P Yeah, I agree with the rest of people in this comment thread: some people just *suck at explaining* :q What's worse, many people suck at noticing it, and they all cheer to the fact that they actually learnt nothing actually useful :P

  • @electromorphous9567
    @electromorphous9567 2 ปีที่แล้ว +138

    For those using 2019 or newer versions of visual studio make sure that in the properties window you have Win32 set to active instead of x64 which is default

    • @kacperpajak3
      @kacperpajak3 2 ปีที่แล้ว +7

      ur my hero

    • @t3st3d
      @t3st3d 2 ปีที่แล้ว +1

      thats why its not working

    • @shavais33
      @shavais33 ปีที่แล้ว +3

      win32? In the project properties? Even if you've downloaded the x64 glfw binary? What if you're trying to create an x64 library/app? If you build glfw from source does it work with x64?
      I was thinking this morning about why it is that C++ is such an enormous pain to use compared with, say, C#, for example. I don't think it's actually the need to deal with pointers or memory management, or the incredible verbosity that's required to satisfy the type checker, or anything really to do with the language itself. That kind of thing can be a bit troublesome, sure. But I don't think any of that is actually what causes the vast majority of the hair tearing and time loss.
      I think the thing that causes the vast majority of the hair tearing and time loss with C++ is all about the build environment. It's related to the 500 or so spurious errors you get, associated with the giant mountain of dependencies you have, if one tiny little thing isn't exactly right. With C++, the actual thing which is causing your problem is referenced by a needle in a haystack. And the needle is probably pointing in the wrong direction.
      Why does that happen with C++ and not with, say, C#, for example?
      I think the key difference is the need to compile header files.
      In C#, and in Python, PHP, Ruby, Lua, etc., the manifest of what is in a library is built into the library itself and is known to the compiler (or jitter or interpreter, etc.) at compile time without needing to depend on the success of the compilation of a header. In C++, if something goes wrong with the compilation of one header, all of the headers that depend on that won't compile either, and so the compiler has no idea what's in any of the whole tree of libraries that depend directly or indirectly on that library.
      I think that by itself is The Thing that causes by far and away the most headaches with C++.
      What if we came up with a new type of library which doesn't require a header to use? What if our C++ libraries imbedded a complete manifest that is explorable by a tool similar to the C# assembly browser?
      If we could manage that, then if one or two calls were mismatched in some way, we'd only get errors about those one or two calls, instead of getting a cascade of errors about every call made by any part of the mountain of dependencies to anything in that library or any of the libraries in the whole tree of libraries that depend directly or indirectly on that library!
      I bet that notion By Itself, with No Other Changes, has the potential to reduce the hair tearing and time loss associated with using C++ by something like 90%.
      "But what about all the header-only libraries!?" We like them because with them at least we don't get link time errors. And they force full disclosure and don't require us to look in two places in order to know how a given function works / exactly what it does. But think about all the horde of compile time errors you get out of STL when something goes wrong in the header compilation process. Is that really better than getting one link time error? If libraries had complete manifests that were readily explorable, the linking process could be merged with the compilation process. If you had the source code for a library, the compiler/linker could potentially direct you to the line of code that caused what is today a link time error. And in header-less C++, you would never need to look in two places to know how a function works / exactly what it does.
      Headers have the advantage of showing you a brief manifest that you can use to navigate to the implementation code. But if an IDE could give you a way to see that browse that manifest, and use it to navigate to the implementation code for a given class or member, and even open little sub windows into it the way VS does with "Quick Actions", without needing to manually create or maintain the header itself, wouldn't that be better?
      Header-less C++. Difficult to come up with, maybe, but I bet it would be worth it in spades.

    • @signedlongint69
      @signedlongint69 ปีที่แล้ว +7

      @@shavais33 It seems your essay is about you hating C++… you do realise it is meant to be a low-level language, don’t you?

    • @shavais33
      @shavais33 ปีที่แล้ว +1

      ​@@signedlongint69 It's not about hating C++ at all! I like C++ in general, in fact I choose to use it in my own projects. I was just proposing the supposition that header files from external libraries that have to be compiled into your project are more trouble than they're worth and that there is a better solution. I think maybe I need to experiment with C++20's "modules" feature.

  • @junehanabi1756
    @junehanabi1756 4 ปีที่แล้ว +156

    The thing Cherno gets right compared to other tutorials is that he focuses on teaching the basics first. While that sounds like many other tutorials it's actually not. There's 2 common and IMHO bad teaching methods others do.
    1) Teach by example (Give you a block of code spanning several lines, explain some of it, but leave you to figure out the rest to understand the basics.)
    2) Teach by building a complex program (Give you a much longer program, explain what each line does without really helping you understand much of it and progressively span several files and thousands of lines teaching you the basics)
    Both of those are ubiquitously common online and many teachers swear it's the best way to learn. But they're both garbage IMHO, you need to start small and play around with one concept at a time with the most minimal lines of code possible. You want focus on the once concept so you don't want any other distractions with too much other stuff going on including other concepts you also haven't fully understood.
    Cherno focuses on helping you understand the concept being taught and encourages you to play around with just that one concept to really learn it. I really wish more teachers did this and not try to throw too much in and have too much going on that you just can't figure anything out, become stressed and overwhelmed, feel abandoned, and ultimately quit. With Cherno's method you actually feel like you understand something and feel like you're having fun.

    • @NavyaVedachala
      @NavyaVedachala 2 ปีที่แล้ว +3

      Exactly! As an absolute beginner, I'm constantly feeling overwhelmed by the gap between what's taught in tutorials and the exercises that are recommended (with no follow-up discussion of solutions)

    • @MrPatak007
      @MrPatak007 2 ปีที่แล้ว

      Source: just trust me dude.

    • @wireghost897
      @wireghost897 ปีที่แล้ว

      I will note this down.

    • @ReplicateReality
      @ReplicateReality ปีที่แล้ว

      Im glad this video was recommended in a comment on another video, sounds good

    • @ReplicateReality
      @ReplicateReality ปีที่แล้ว

      @@MrPatak007 what?

  • @snowfrog8866
    @snowfrog8866 6 ปีที่แล้ว +32

    Your videos have such a remarkable production quality. You really seem to have an innate sense of how to teach things in a simple and effective way. Thank you so much for your great work!

    • @_Boni_
      @_Boni_ 4 ปีที่แล้ว +1

      Speaks too fast.

  • @satishgoda
    @satishgoda 4 ปีที่แล้ว +16

    It has been 13 years since I wrote my last OpenGL program. Thanks to you I am back in the game with modern opengl programming.

  • @PoppySeed84
    @PoppySeed84 ปีที่แล้ว +2

    dude u are a gifted person. its a real inspiration. ur probly a 1 in a million (at least) person. not only being extremely knowledgeable and talented in software development, but being able to help people build their skills. its honestly amazing.

  • @SPL1NTER_SE
    @SPL1NTER_SE 6 ปีที่แล้ว +3

    All of your videos are insanely good and I'm so excited about this tutorial series. I've bought several recommended C++ and game programming books, but they don't come close to TheCherno's videos in terms of quality. I'm finally going to really learn how to make something using OpenGL. Everything else I've read or watched on the matter has been outdated legacy crap or broken links or just obvious bad practice.
    Seriously, I have not been this excited about any TH-cam content (or probably anything else, for that matter) for ages.
    Thank you so much for doing this (FOR FREE) and keep up the excellent work!

  • @whatsup7341
    @whatsup7341 4 ปีที่แล้ว +8

    Thanks Cherno, most C++ tutorials I have found with libraries make me feel like I'm just sort of hacking together something that works, but you have cleared a lot of that fog. Thanks.

  • @supersquare
    @supersquare 4 ปีที่แล้ว +6

    Yeah, you know I just hit that damn notification bell. You're one of the best teachers I've ever seen. Thank you so incredibly much for providing all of these amazing resources!

  • @MiningMadness0029
    @MiningMadness0029 6 ปีที่แล้ว +294

    Just a side note for those on Windows, you don't actually have to go through the process of linking all those libraries at 15:38, you can just type in "%(AdditionalDependencies)" to include all the default libraries for you. No need to Google the errors and link them manually. :)

    • @antibab5023
      @antibab5023 5 ปีที่แล้ว +5

      Thank You!

    • @sutoreikyatto
      @sutoreikyatto 5 ปีที่แล้ว +5

      didn't work for me

    • @vertigo6982
      @vertigo6982 5 ปีที่แล้ว +36

      "%(AdditionalLike)"

    • @YTHandle660
      @YTHandle660 4 ปีที่แล้ว +2

      Thank you worked very well. Saved me lots of time!

    • @nickrooker6368
      @nickrooker6368 4 ปีที่แล้ว +3

      Doesn't work

  • @the_jono
    @the_jono 4 ปีที่แล้ว +41

    So much anticipation for a single triangle.

    • @jellohunter7981
      @jellohunter7981 3 ปีที่แล้ว +3

      @Comlud Cries in a 1000 lines of code

    • @xrafter
      @xrafter 3 ปีที่แล้ว

      @@jellohunter7981
      What is vulkan

    • @sagnost
      @sagnost 3 ปีที่แล้ว

      @@xrafter another graphics api

    • @xrafter
      @xrafter 3 ปีที่แล้ว

      @@sagnost
      I know this one month i learned a lot

  • @DaftHacker
    @DaftHacker 6 ปีที่แล้ว +4

    I actually really liked how you linked everything from scratch just to see what the basic requirements were to get it running.

  • @ququ5463
    @ququ5463 5 หลายเดือนก่อน

    this is the first time i understand a subject on coding this clearly. you explanations are simple yet they cover a lot. thank you for making this video, i really appreciate it!

  • @MrBmxerFTW
    @MrBmxerFTW 6 ปีที่แล้ว +4

    I'd just like to thank you for making the process of setting up opengl so simple, while simultaneously learning extremely important aspects of c++ development.

  • @MrBatraaf
    @MrBatraaf 3 ปีที่แล้ว +1

    Nice job man! I had to pause the video a couple of times to keep up, but the reward was an intense feeling of happiness when I saw a simple white triangle appear on screen.
    I will definitely be checking out all your other tutorials.
    Take care.

    • @blocksofwater4758
      @blocksofwater4758 3 ปีที่แล้ว

      did you get a "glfw.lib cannot open" and if you did , how did you fix it?

    • @MrBatraaf
      @MrBatraaf 3 ปีที่แล้ว

      @@blocksofwater4758 No, but when you get library errors like that there are basically only a few possibilities:
      - the .lib file that you downloaded is corrupt or still zipped or stored in a place where the compiler cannot "see" it.
      - the compiler is not pointed to the correct files in the project settings
      In one of the next tutorials I made the mistake of linking both the dynamic and static libraries, and then the project would not work until I placed rhe .dll file in the project folder.
      Btw, Cherno also has an excellent tutorial on the use of libraries in general.
      I would recommend you practice by creating a simple library of your own; maybe a simple calculator or some string manipulation functions.
      In my experience, the trickiest part of programming is not the programming itself, but setting up the toolchain and the compiler.
      More than once I got so frustrated that I left the whole thing for a while.
      The subject is a little boring, but it's worth spending some extra time and effort.
      What also helps is to compile some simple programs from the command line, rather than using the IDE.
      That will give you a better understanding of what is happening under the hood.

  • @fountainwindmill
    @fountainwindmill 6 ปีที่แล้ว +6

    Really excited for this series! I have come moderately far with LWJGL (Java with OpenGL), but I'd rather use C++ because it's faster if you know what you're doing. I'm glad I have found you because most tutorials on TH-cam are outdated and/or don't explain things very well.

    • @10goni
      @10goni 6 ปีที่แล้ว

      Vena text tutorials are the way to go though.

    • @fountainwindmill
      @fountainwindmill 6 ปีที่แล้ว

      CAPSLOCK yeah, I know. It's just that my attention span has decreased significantly because of all the modern tech. I own the OpenGL red book though, so if I ever get stuck or something I can read about it.

  • @davidpike766
    @davidpike766 5 ปีที่แล้ว

    Your clarity is your strength, thank you for the videos Cherno

  • @Tiogar60
    @Tiogar60 4 ปีที่แล้ว

    just gotta say, thank you so much for doing all theese tutorials :)
    I found your channel just a few months ago and i have learned more about C++ than i would ever have otherwise.

  • @__dark_channel__
    @__dark_channel__ 4 ปีที่แล้ว +19

    g++ k.cpp -Iincludepath -Llibpath -lglfw3 -lopengl32 -lgdi32
    you put your paths after -I and -L as shown above. I for include and L for library. Note that even though it's called libglfw3.a gcc you only need to type -lglfw3 into gcc. This is for the windows 64bit version of glfw. I was stuck on this so hope this helps.

    • @CreepyMemes
      @CreepyMemes 10 หลายเดือนก่อน

      -l:libglfw3.a also works

  • @nickbryan894
    @nickbryan894 ปีที่แล้ว

    Dude thank you so much ive been trying to get this running for 3 days and your video had me up and running in 30 minutes

  • @DAToft
    @DAToft 3 ปีที่แล้ว

    Thank you, thank you, thank you! You are a godsend! I'm trying to get GLFW to work with VS Code, but the tutorials out there right now are few, far between, and often outdated. I was able to use this video to transfer the linking over into VS Code, and after 2 days of struggling with this, it's finally working! Thank you so much

    • @kajalsanklecha267
      @kajalsanklecha267 3 ปีที่แล้ว

      Can you elaborate on how you got it working, please?

  • @Wolf_and_Fox
    @Wolf_and_Fox 4 ปีที่แล้ว +4

    This is the absolutely best openGL tutorial video!

  • @Evildea
    @Evildea 4 ปีที่แล้ว +3

    I came to learn OpenGL but I'm so happy you showed us how to fix linking issues. I've done C++ courses and they've never showed us how to debug a linking issue and you made it so clear with the simple Google search.

  • @davep7176
    @davep7176 ปีที่แล้ว

    I've haven't had to do this for many years (since I have been working in Unity and Unreal game engines mostly) and I forgot how annoying it was. I used to do these links all the time without even thinking but I never really even understood exactly what it was all doing. All the extra info you provide along the way in this video was very helpful to me. Thanks.

  • @dimitar45802
    @dimitar45802 2 ปีที่แล้ว

    Really good video! You are the best teacher! I have Webgl in university but was curious to try Opengl, also, these were my first lines of c++ code, thank you!

  • @kinochdotcom
    @kinochdotcom 2 ปีที่แล้ว

    I had avoided this series because most tutes spend 15 mins trying to tell me what the difference in a char and an int is or an hour long talk on CALLBACKs. I should have known you would get straight to the point. Look forward to finishing this series and get up to date on what all is happening now with OpenGL. Thanks for all you do and I wish you success in your endeavors.

  • @slavago1266
    @slavago1266 5 ปีที่แล้ว +5

    Thanks God I have found a person who explained how to "install" OpenGL stuff, how to configure it and it works on my computer! Thank you!

  • @arthshah94
    @arthshah94 5 ปีที่แล้ว +1

    Keep up the good work man. Thanks for explaining the concepts from Scratch.

  • @spicytuna08
    @spicytuna08 5 ปีที่แล้ว +6

    Everything compiles and links but I am f getting: Unhandled exception at 0x00FA7F50 in OpenGL VS.exe: 0xC0000005: Access violation reading location 0x00000280.
    does anyone know why?

  • @noiredelune174
    @noiredelune174 4 ปีที่แล้ว

    I'm really impressed... and so glad your'e doing these videos!! You make things so clear and fun! Respect! \m/

  • @spytec3408
    @spytec3408 4 ปีที่แล้ว +3

    10:20 so should I use the vs 2017 lib in the more updated GLFW, or keep using the 2015 lib?

  • @numaanjaved
    @numaanjaved 3 ปีที่แล้ว

    its really good to create something from scratch, i learned from it, and i need to do it every time i create something, until and unless i master it .. good stuff

  • @tranxuanuc9509
    @tranxuanuc9509 4 ปีที่แล้ว +1

    This video is so great. Thanks for this series!!

  • @chastitywhiterose
    @chastitywhiterose 3 ปีที่แล้ว

    I followed this step by step with Visual Studio 2019 and got it working! This is the most success I've ever had with Visual Studio. It's so big and hard to navigate.

  • @calumjohndiprose1809
    @calumjohndiprose1809 5 ปีที่แล้ว +2

    This is looking like it's going to be a great series! can't wait to get stuck in

  • @h.hristov
    @h.hristov 6 ปีที่แล้ว

    Followed along, got a triangle on my screen. Thanks Cherno! Really excited for this series

  • @johnnyenglish3503
    @johnnyenglish3503 ปีที่แล้ว

    15:19 this is the most helpful thing ive learnt in programming thank you so much

  • @gc-0377
    @gc-0377 3 ปีที่แล้ว

    I love you Cherno, Now I'm taking a Computer Graphics in the Univesity and this saved my life, thnks bro you are awesome

  • @catorials444
    @catorials444 3 ปีที่แล้ว +3

    I have, no doubt infinite respect for this guy.

  • @akashsinghdahiya5862
    @akashsinghdahiya5862 2 ปีที่แล้ว

    Good Work particularly resolving the errors related to dependencies👍🏼.

  • @abdullahhaidar3658
    @abdullahhaidar3658 5 ปีที่แล้ว

    Thank you dude so much , this the first time I tried something that worked for the first time without any trouble

  • @storianostorianov3955
    @storianostorianov3955 2 ปีที่แล้ว

    Awesome video. Greatly and calmy explained complex concepts. Thanks!

  • @berkeleymorrison
    @berkeleymorrison ปีที่แล้ว +3

    its so fun learning opengl with harry styles

  • @pch1511
    @pch1511 6 ปีที่แล้ว +3

    Can't wait for the rest of this tutorial!

  • @denilsongabriel1890
    @denilsongabriel1890 4 ปีที่แล้ว +2

    mas allá de hacer un triangulo.. aprendí muchas cosas que daba por sentado. Gracias TheCherno!

  • @asura-2467
    @asura-2467 ปีที่แล้ว

    -_- Everything went over my head. I think things might get clearer as i go down on playlist. Thanks for the video ,Sir!

  • @alexjulius69
    @alexjulius69 2 ปีที่แล้ว

    I've been always typing code myself off the screen of a tutorial, you're right, this is the best way to learn.

  • @rajasparanjpe3791
    @rajasparanjpe3791 4 ปีที่แล้ว +1

    I like how he is organized with his videos and playlists.

  • @jasamgladaan
    @jasamgladaan 5 ปีที่แล้ว

    wow man! you rock! great explaination so far, gonna follow your tutorial till the end for sure!

  • @deeplearner2634
    @deeplearner2634 4 ปีที่แล้ว +29

    after coding the triangle, the build works but when I run it, no triangle... what could be the problem?

    • @DanielArnett
      @DanielArnett 4 ปีที่แล้ว +8

      Make sure you copied the numbers at 18:55 properly.

    • @LosfrogerX
      @LosfrogerX 4 ปีที่แล้ว +1

      I had to cast the numbers to GLfloat like this: glVertex2f(GLfloat(-0.5),GLfloat(-0.5));

    • @xeliani.7809
      @xeliani.7809 4 ปีที่แล้ว +3

      @@LosfrogerX All you need is : glVertex2f(.5f, .5f); the .5f instead of casting

    • @zhyyn2054
      @zhyyn2054 3 ปีที่แล้ว +4

      Had the same issue turns out I had written glEnd; instead of glEnd();

  • @jamesm7414
    @jamesm7414 2 ปีที่แล้ว

    Very impressed that I did this tutorial and it all works first go!

  • @vectoralphaAI
    @vectoralphaAI ปีที่แล้ว +1

    Thank you Cherno for making this tutorial i look forward to learning OpenGL. Although i honestly would have preferred if you just made a tutorial for linux users on how to install and set up GLFW because i spend several hours trying to figure out how it even works or how to build and install it. Thankfully i used ChatGPT to help me and solve the problems and got the window and triangle to render on screen. Anyway looking forward to the rest of the series. Hopefully nothing else breaks along the way. lol

  • @prima_ballerina
    @prima_ballerina หลายเดือนก่อน

    As a linux user I will never understand how devs on windows have the patience to work through this awful tedious setup process. Always takes me back to when I studied computer science at university. I was a hardcore windows user until then. At the first day we got a tutorial how to connect to our accounts via vpn. There were like ~3 pages of screenshots and "click here / click there" descriptions for windows and on the 4th page were a couple of lines to type into your terminal when you're on linux. When I went home I installed linux on the formerly win7 laptop and never looked back.
    Anyway: you did a real good job of explaining it all. Respect!

  • @docherrydoelly
    @docherrydoelly 3 ปีที่แล้ว

    all your explanations are so helpful to me. Thank You so much!

  • @tolgask2812
    @tolgask2812 2 ปีที่แล้ว

    I kinda like the keyboard sound in the video. I've never realize it in dev videos. It gives a quite satisfaction.

  • @thebigpaff
    @thebigpaff 5 ปีที่แล้ว +18

    TheCherno should have 1m subs, not 100k, good job, keep it up

  • @leimiles18
    @leimiles18 3 ปีที่แล้ว +1

    Hi, Cherno, I got a msg after followed your steps, says "defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library", and the triangle doesn't show up, could you tell me why, please?

    • @leimiles18
      @leimiles18 3 ปีที่แล้ว

      I'm using vs studio 2019 btw.

    • @leimiles18
      @leimiles18 3 ปีที่แล้ว +1

      Sorry to bother, seems my problem is caused by the color, if i use glColor3f(1, 1, 1) before draw the triangle, it works.

  • @drakedodson2250
    @drakedodson2250 5 ปีที่แล้ว

    For some reason when ever I try doing the $(SolutionDir)Dependencies\.... it never gives the second OpenGL folder so I have to put $(SolutionDir)OpenGL\Dependencies\ in order for it to work, any way I can resolve this?

  • @EmmetMozart
    @EmmetMozart 6 ปีที่แล้ว

    at @18:55 intellisense is not working on my project with the legacy OpenGL, how can I fix this? (I'm using Visual Studio Community 2017, win 10 x64, i5 and an AMD graphics card) thanks in advance

  • @derrickminer8583
    @derrickminer8583 ปีที่แล้ว

    Hey Cherno. I have a question. I'm using emgucv for object tracking and video frame subtraction etc. I got interested in OpenGL and thought it might be a good addition to my projects, maybe animate or overlay some of the desired frame results etc. It looks like the military might be using similar techniques with their drone work when scoping enemy targets on the grounds. can you please give me your thoughts on this?
    Thanks
    Derrick

  • @PraveenMax
    @PraveenMax 6 ปีที่แล้ว

    Best video for fixing the GLFW link error . Thanks a lot..!

  • @SantiRodriguezRuiz
    @SantiRodriguezRuiz ปีที่แล้ว +5

    I'm following this video series but using Linux, which makes it a bit challenging. But I found that ChatGPT has been very useful to find out how to link the libraries and generally make the triangle appear. I just prompted "how do I draw a triangle with glfw in opengl in C++ under linux" and it gave me what to write (which is the same Yan is describing in the video), and which parameters to use on the compiler.

  • @user-rr7je8lf2d
    @user-rr7je8lf2d 2 ปีที่แล้ว

    Thank you so much for that simple and nice explained
    tutorial.

  • @drewbruggman
    @drewbruggman 5 ปีที่แล้ว

    At around 9:18 you said you’d provide a link to a video about static libraries or whatever. Just thought you could use a notification. Just finding out about your series. Love your work dude!

  • @sirrhynus4280
    @sirrhynus4280 6 ปีที่แล้ว +72

    For everyone who is serious about learning OpenGL:
    UDPDATE YOUR DRIVERS!!! DO IT!!

    • @strange7089
      @strange7089 6 ปีที่แล้ว +1

      and how to do that ???

    • @sirrhynus4280
      @sirrhynus4280 6 ปีที่แล้ว

      Go to the site of your graphics card provider and download their latest driver/updater for your gpu.

    • @TheVopi
      @TheVopi 6 ปีที่แล้ว +1

      Strange ! Probably Intel I imagine.

    • @trevorthieme5157
      @trevorthieme5157 5 ปีที่แล้ว

      @@TheVopi Intel does cpu only to my knowledge.

    • @Supafly6420
      @Supafly6420 5 ปีที่แล้ว +7

      @@trevorthieme5157 Intel have their own graphics drivers for their onboard graphics that are mostly built in to the motherboards. Intel Graphics

  • @FcSteezey
    @FcSteezey 6 ปีที่แล้ว

    love your videos mate, keep it up

  • @mikicerise6250
    @mikicerise6250 ปีที่แล้ว +1

    I'm on Linux and using clang++ and Make, so far removed from the Visual Studio configuration environment on Windows, but you totally demystified linker errors for me with your "welp, let's look for the missing library" approach... I got it up and running in a few minutes as soon as I saw you breeze through those linker errors by just asking, "what library has this function?". Thank you for all you do, Cherno! :)

  • @IndellableHatesHandles
    @IndellableHatesHandles 3 ปีที่แล้ว +1

    I just compiled GLFW from source. Awesome!

  • @moviemaker1220
    @moviemaker1220 6 ปีที่แล้ว +4

    I have copied exactly what is done in this video, but my window does not open when I run the application, any thoughts on why?

  • @theblinkingbrownie4654
    @theblinkingbrownie4654 3 ปีที่แล้ว +15

    20:25 lmao the subtitle guy gave the patreon of scishow.

  • @navidzaboli2710
    @navidzaboli2710 6 ปีที่แล้ว +2

    You should make a tutorial about OpenGL Particle Systems :)
    They're so fun and satisfying to watch, and there's not really any good tutorials about it on TH-cam :)
    P.S Big fan, love your videos.

  • @suryakarmakar4240
    @suryakarmakar4240 2 ปีที่แล้ว +1

    Is there any better alternative than glfw?
    Also writing window management libs on our own for each platform have any performance benefits?

  • @frogstair
    @frogstair 5 ปีที่แล้ว +1

    So glad I found this channel!

  • @Ocmersh
    @Ocmersh 4 ปีที่แล้ว

    Love the epic background music

  • @shambhav9534
    @shambhav9534 3 ปีที่แล้ว +5

    4:55 "Non trivial" Those are the scariest words one can hear while trying to install something and make a tech related thing work.

    • @shambhav9534
      @shambhav9534 2 ปีที่แล้ว +1

      Well, I just used SDL instead of using 10 small libraries, which is way easier and way easier to set up.

  • @hackpiece3094
    @hackpiece3094 5 ปีที่แล้ว +1

    There are no compile errors ..but ctrl+shift+b = error LNK1104: cannot open file 'glwf3.obj'
    And
    On F5= Unable to start program '......\....\projectname.exe'
    The system cannot find the file specified.
    Can anyone help?

  • @MarinPlayLista
    @MarinPlayLista 6 ปีที่แล้ว

    Tnx for this great series! I hope that you will cover Physically based rendering in depth.

  • @isaacwolf2806
    @isaacwolf2806 6 ปีที่แล้ว

    Cherno, I went through your entire game engine series, and haven't done any graphics programming since. Really excited for this series! I've already learned a lot from this video!

  • @rcookie5128
    @rcookie5128 6 ปีที่แล้ว

    Awesome!!
    I initially had problems setting GLFW up on VS13, as the $(SolutionDir) Makro didn't had the right path to the solution folder itself, but to the project folder (so one hierarchy level above); dunno why but now everythings works fine and dandy..

  • @harshitjoshi3082
    @harshitjoshi3082 2 ปีที่แล้ว

    Thank you so much for making this video !

  • @IndellableHatesHandles
    @IndellableHatesHandles 3 ปีที่แล้ว +3

    As someone who wants to capitalize off his new free time during the pandemic, this series is amazing.

    • @Seiseary
      @Seiseary 3 ปีที่แล้ว

      yeah

  • @navid2368
    @navid2368 5 ปีที่แล้ว +2

    Cherno, thank you so much for this series. I have a question.
    In the first video you said OpenGL is not a library and that there's no "code" for OpenGL. However you included a file named opengl32.lib in visual studio. Can you explain what that is?

    • @x-lightsfs5681
      @x-lightsfs5681 5 ปีที่แล้ว

      He used legacy opengl just as a smiple demo, in future episodes he doenst do that anymore

  • @m_remon
    @m_remon 3 ปีที่แล้ว

    Yeah pretty cool and everything but how di I install the visual c++ on visual studio.
    Seriously I can't find the framework/thing i have to install to even make an empty project on visual c++

  • @bijianwu5124
    @bijianwu5124 3 ปีที่แล้ว +1

    thanks for making these very helpful videos

  • @jacobhaig2372
    @jacobhaig2372 6 ปีที่แล้ว +1

    The only videos I'm excited for!
    Notification squad FTW

  • @bkovacs6
    @bkovacs6 6 ปีที่แล้ว +1

    Intelligence displays itself by able to explain clearly and simply like Cherno does.

  • @fadiha2746
    @fadiha2746 3 ปีที่แล้ว +1

    Even if the last comment was a long time ago, perhaps someone can help me to understand why when setting up all the stuff explained by cherno but using Visual Studio Code instead of VS, and two different compilers, I manage to compile and link with both MingW and MIngW64 but the window only open with the 32bit version whereas it seems that the 64bits crashes.

  • @oksanaholie
    @oksanaholie 4 ปีที่แล้ว

    Hi, Cherno. Do you know anything like maven for java, but for c++ for dealing with libraries and plugins adding dependencies???

  • @il4w
    @il4w 3 ปีที่แล้ว

    In vs2019 there's an additional file called glfw3_mt.lib do we delete that too ?Also please tell us the purpose of that static lib and the dll static lib too(by dll static lib i mean the lib not the dll library itself with the .dll extension)

  • @angeldominguezplata8161
    @angeldominguezplata8161 4 ปีที่แล้ว

    i don't understand how you are so inteligent, thanks for all

  • @bytelab3268
    @bytelab3268 3 ปีที่แล้ว

    Would vcpkg be fine for Major projects or should I always add libraries my self?

  • @Xxp0r
    @Xxp0r 6 ปีที่แล้ว +1

    What's the advantages to using the $(SolutionDir)Dependencies macro vs ..\Dependencies relative path?

  • @aryanparekh9314
    @aryanparekh9314 3 ปีที่แล้ว

    Worked flawlessly for me !

  • @popCORNcandy
    @popCORNcandy 5 ปีที่แล้ว

    Hi. Thanks for creating and sharing the videos. Is it possible to share the detail of the guitar which is standing on the top left of the screen? It looks sharp. :)

  • @theredstonehive
    @theredstonehive 5 ปีที่แล้ว +3

    "cannot open file 'glfw3.libs'" What do I do now?
    I have set the Linker up correctly, and I have chosen a 64 bit file for my 64 bit project...
    Is it because I followed along and added them back in as you said in 32 bit?
    EDIT: It turns out I set it to glfw3.libs instead of glfw3.lib. Silly mistake :)

    • @borogamer7188
      @borogamer7188 5 ปีที่แล้ว

      Truly sucks when it happens

    • @devguyahnaf
      @devguyahnaf 5 ปีที่แล้ว

      I also had the same problem because i set it to glfw.3.lib silly me