OpenGL 3D Game Tutorial 1: The Display

Поділитися
Вставка
  • Опубліковано 30 вер 2024
  • LWJGL 2 tutorial series on how to create a 3D Java game with OpenGL!
    Tutorial about setting up the project:
    • Setting up a LWJGL Pro...
    Full code:
    github.com/The...
    Common Problems:
    -In case you had annotations off, you need to do the ContextAttribs stuff all in one line like this:
    ContextAttribs attribs = new ContextAttribs(3, 2).withForwardCompatible(true).withProfileCore(true);
    -If you get the following error: org.lwjgl.LWJGLException: Could not create context (WGL_ARB_create_context) then your computer may not support the version of OpenGL that we're trying to use (version 3.2). Try removing the parameters from the Display.create() method and try again.
    - Make sure you didn't miss the "!" in the "(!Display.isCloseRequested())" part.
    LWJGL Wiki: lwjgl.org/wiki/...
    My UA-cam Channel: / thinmatrix
    Follow me on Twitter: / thinmatrix
    Check out my game on IndieDB: www.indiedb.com...

КОМЕНТАРІ • 1,1 тис.

  • @Neightr0
    @Neightr0 5 років тому +578

    Beginner game developer: *exists*
    ThinMatrix: "I'm about to start this man's whole career."

  • @thebuizelclub
    @thebuizelclub 9 років тому +15

    This is what I have been looking for!

  • @Joern290
    @Joern290 10 років тому +1

    Love your tutorial series TM! So helpful! Can't wait for the next one!!

  • @maxderbenwick8359
    @maxderbenwick8359 8 років тому +1

    Thanks so much for this series!!

  • @boltzblocks5535
    @boltzblocks5535 7 років тому +3

    OMG MAN YOUR AMAZING THANK YOU SOO MUCH IF I MAKE MY GAME WELL U WILL HAVE ALLOT OF SHOUT OUTS

  • @swolyjr
    @swolyjr 8 років тому

    i set up the java from the other video, but when i went back to your video to continue, i dont know where u got all the other folders and classes from. Do you have another video before this one? i only have "JGame" and like 5 items (folders) under it. What am i missing? please help

    • @ThinMatrix
      @ThinMatrix  8 років тому

      +swolyjr Sorry for the confusion, the "JGame" project in my eclipse is my personal project. The project I'm using for this tutorial series is called "gameEngine" which doesn't have any extra classes or folders.

  • @garrettord3304
    @garrettord3304 10 років тому

    You mentioned somewhere that you are working full time on your game, and not working a full time job. Just out of curiosity, how are you managing that? Are you getting donations to support development of your game? Or maybe just working out-of-pocket from savings?

    • @ThinMatrix
      @ThinMatrix  10 років тому

      Gaxx Sama A couple of years ago I worked for a year in Berlin and saved up a decent amount of money. Now I'm just working my way through those savings! I'm hoping to do a kickstarter campaign or some other fundraising next year when I start running out of money, so that I can continue development :)

    • @sledgehogsoftware
      @sledgehogsoftware 10 років тому +1

      ***** Wow. Good luck! I'll certainly donate when I can. And you could set up a tipjar when UA-cam Sets that up.

    • @ThinMatrix
      @ThinMatrix  10 років тому

      Battlefrog Thank you :)

    • @sledgehogsoftware
      @sledgehogsoftware 10 років тому

      *****
      Welcome.

  • @rexerinooogaming4404
    @rexerinooogaming4404 9 років тому

    So I was having problems initializing OpenGL but then i deleted the new PixelFormat(), attribs in the display.create() line and it worked perfectly... Will this cause errors later in the project?

  • @abhilashkrish
    @abhilashkrish 2 роки тому +19

    Can you please create a new 3D game development series using LWGL3?

    • @AheadDev
      @AheadDev 5 місяців тому

      if you really need to learn lwjgl 3 just learn lwjgl2 in this series and from then on it's easy to switch to 3

  • @O1dBay
    @O1dBay 3 роки тому +8

    TO ANYONE DOING THIS TUTORIAL IN 2021! LISTEN UP! Be sure to set the Java version to 1.8 or else your project will not work.

  • @vitor-a12
    @vitor-a12 6 років тому +278

    Hey! You're seeing this for the first time. Let me warn you: this is gonna be a epic journey, enjoy!

    • @rae4652
      @rae4652 6 років тому +12

      thanks, I will come back to this when i finish the series xD

    • @cj2dabj
      @cj2dabj 5 років тому +3

      @@rae4652 You finish it?

    • @Benethen_
      @Benethen_ 5 років тому

      yup, i'm really excited to get this goin, don't think i'll get bored out of it.

    • @live_destin-3408
      @live_destin-3408 5 років тому

      ikr im so pumped

    • @Pedro-nd6dd
      @Pedro-nd6dd 4 роки тому +1

      VALEU POR AVISAR!

  • @KevinWho
    @KevinWho 4 роки тому +12

    If you get the error:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
    at engineTester.MainGameLoop.main(MainGameLoop.java:10)
    Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 1 more
    make sure you added the libraries under classpath, not ModulePath

    • @SkeletonSSBM
      @SkeletonSSBM 3 роки тому +2

      thanks so much!

    • @kotcstudios
      @kotcstudios 2 роки тому

      You are a super hero!!!
      On the good side, I did get my driver updated trying to figure this one out, lol.

  • @staticvoidsolutions4998
    @staticvoidsolutions4998 2 роки тому +5

    Hey - these look great, thanks so much for your efforts! A quick question before diving in: These were released in 2014. I see from some other comments (several years old themselves) that this material is still relevant, the main areas of concern being GFLW is used now for window display and input and for math we can use JOML. Is that still the case? I am a bit confused because some comments indicate that you are using version 2 of LWJGL but here in this first video you are using 3.0. Can I follow these with the latest release? Thanks for your input. Cheers :)

    • @ThinMatrix
      @ThinMatrix  2 роки тому +4

      The main aim of the tutorials is to teach OpenGl. OpenGl is the API that allows us to render 3D graphics. In these videos I use OpenGL 3+, which is still relevant today (and I use for my games).
      LWJGL is the Java library that gives us access to the OpenGL API. It also handles other useful things, such as window creation and user inputs. In the videos I use LWJGL 2, but the current version available today is LWJGL 3. All the OpenGL code is the same, all the gamedev concepts I teach are still relevant, it's just the things specific to LWJGL 3 that are different. As mentioned, these primarily include setting up the display and handling user inputs. So if you can learn how to do those two things with LWJGL 3 elsewhere, then you can follow these tutorials for everything else.

    • @staticvoidsolutions4998
      @staticvoidsolutions4998 2 роки тому

      @@ThinMatrix Thank you! Cheers :)

    • @ItsMeChillTyme
      @ItsMeChillTyme 2 роки тому

      Had the same concern, glad you got a reply! By any chance, do you know how to pack a game made in Java utilising OpenGL for the Web?

    • @staticvoidsolutions4998
      @staticvoidsolutions4998 2 роки тому

      @@ItsMeChillTyme at the end of this guys series packaging is discussed: ua-cam.com/video/VyKE7vz65rY/v-deo.html

    • @ItsMeChillTyme
      @ItsMeChillTyme 2 роки тому

      @@staticvoidsolutions4998 thank you so much!

  • @MohammedPlaysMC
    @MohammedPlaysMC 9 років тому +21

    Back to the start again. Going to redo all these tutorials probably will take less time then they did before and also will comment everything so I understand it. Today is the day I start a game not just props for a game :D

  • @destinydonut
    @destinydonut 5 років тому +11

    Great Video! , it would be great if you remade this series with LWJGL 3.

  • @ThinMatrix
    @ThinMatrix  8 років тому +45

    *Common Problems and Solutions:*
    If you get the following error: *org.lwjgl.LWJGLException: Could not create context (WGL_ARB_create_context)* or *Pixel format not accelerated* then your computer may not support the version of OpenGL that we're trying to use (version 3.2). Try removing the parameters from the *Display.create()* method and try again. You may have trouble on the later tutorials however, depending on exactly which version of OpenGL your computer supports.
    Also, in case you had annotations off, you need to do the ContextAttrib stuff all in *one line* like this:
    ContextAttribs attribs = new ContextAttribs(3, 2).withForwardCompatible(true).withProfileCore(true);
    If the display opens and closes straight away without an error then make sure you didn't miss the *!* in the *(!Display.isCloseRequested())* part.

    • @geometrydashadrian2329
      @geometrydashadrian2329 8 років тому

      +ThinMatrix why won't you show us how to make a socuwan type-game?

    • @ThinMatrix
      @ThinMatrix  8 років тому +1

      +Geometry Dash Adrian That's exactly what this series is doing. In this tutorial series I've now covered almost all the OpenGL concepts that I used in Socuwan. In fact, a lot of the stuff I've shown in this series is better than in Socuwan because when I was implementing this stuff in Socuwan I was doing it for the first time.

    • @geometrydashadrian2329
      @geometrydashadrian2329 8 років тому

      +ThinMatrix OK, but you didn't upload Episode 40

    • @ThinMatrix
      @ThinMatrix  8 років тому +1

      Geometry Dash Adrian I only just uploaded episode 39 a couple of weeks ago :P The Opengl tutorials go out every 2 weeks, so the next one will be out tomorrow.

    • @geometrydashadrian2329
      @geometrydashadrian2329 8 років тому

      +ThinMatrix Hope u promise bro :)

  • @tweetyguy7347
    @tweetyguy7347 4 роки тому +16

    hi from 2019 new years night! so basically I am in 2020

    • @noon453gf
      @noon453gf 4 роки тому +1

      20/02/2020 :)

    • @chelovekchelovekov5134
      @chelovekchelovekov5134 4 роки тому +1

      @@noon453gf 29/02/2020

    • @noon453gf
      @noon453gf 4 роки тому

      @@chelovekchelovekov5134 hhhh thats good

    • @duck3921
      @duck3921 4 роки тому +3

      Oh boy well wait till you see what's in store for you!

    • @spectrum1324
      @spectrum1324 4 роки тому +1

      you don't want to be in 2020 stay in 2019

  • @skywalker778
    @skywalker778 5 років тому +9

    Hey, mine throws this: `Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/Unsafe`, what can i do?

    • @therealmemernet
      @therealmemernet 5 років тому +2

      same. I really don't know what to do here.

    • @therealmemernet
      @therealmemernet 5 років тому +10

      okay, i found a solution from somebody else. you move all 3 jar files to classpath and delete modle-info file.

    • @skywalker778
      @skywalker778 5 років тому +2

      @@therealmemernet thanks! I'm gonna try it

    • @therealmemernet
      @therealmemernet 5 років тому +2

      @@skywalker778 no problem!

    • @therealmemernet
      @therealmemernet 4 роки тому +2

      @Kürassier1806 Damn, it's been 8 months since I posted that(it feels like yesterday). I'm glad my solution helped you!

  • @AizarkLizard
    @AizarkLizard 2 роки тому +2

    Note that the author used the eighth java. In no case try to follow the instructions if you have a different Java, for example 16. I have been looking for the cause of the errors for a very long time, until I changed the Java to an older one.

  • @loganhodgsn
    @loganhodgsn 9 років тому +50

    Do note that in LWJGL 3 the "Display" class has been replaced with "GLFW" class.

    • @BanditLeader
      @BanditLeader 8 років тому +1

      So everything that says "Display" i have to replace it with "GLFW"?

    • @Geosearchef
      @Geosearchef 8 років тому +5

      +Bandit Leader No. If you're switching to LWJGL 3, you would have to. But this tutorial series is still for version 2(.93). I'm still working with the "old" version myself, the major change in the newer one is that the developers thought it was becoming to big so they removed a few things. It's now e.g. using a different library for managing the display (GLFW) and there are some elements missing you would have to implement yourself (the mathmatical classes in the util package).
      Of course you can still use the "old" version, it's the same OpenGL, and you can follow this really awesome series easier.

    • @razorblade413
      @razorblade413 8 років тому +4

      +Geosearchef Please don't switch to LWJGL 3 because I was using that (LWJGL 3.0.0b build 64) until I got stuck in input camera.
      i can't get position normal or delta from the mouse class, so now I'm redoing all the work but with LWJGL 2.9.3 because the 3 version is a pain in the ass XD.

    • @pcbingemaster
      @pcbingemaster 8 років тому

      thanks, I was freaking out, thought something was wrong with autocompletion

    • @armywife04012000
      @armywife04012000 7 років тому

      :P thank goodness i got v2 of LWJGL '':{

  • @kurtpublic631
    @kurtpublic631 3 роки тому +2

    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    Display cannot be resolved
    at game/engineTester.MainGameLoop.main(MainGameLoop.java:22)
    My line 22: while (!Display.isCloseRequested()) {

  • @EverythingForNothing917
    @EverythingForNothing917 7 років тому +19

    I've been looking for a tutorial like this for a couple years, glad I finally found it. So many tutorials talk about the java language itself which bores me and I have to "try" and skip ahead but miss things. I'm already highly experienced in Java as a whole, just not game development. Thank you for making this. I will start watching and going through these in my free time. :)

  • @DJStrife
    @DJStrife 10 років тому +29

    "We are using LWJGL and OpenGL 3+"
    subscribed!

  • @Triplaglol
    @Triplaglol 10 років тому +20

    After hours of searching, I FINALLY found the problem. Even after updating drivers and looking up what version of Opengl my driver supported (which was 4.4) it still did not work. If you are having this problem you are most likely on a laptop.
    Apparently, on most laptops there are 2 GPU's: the Intel(R) HD Graphics one and the NVIDIA Geforce one. For most PC use, the onboard Intel graphics hardware is just fine. You will not notice a difference between onboard and discrete graphics when using desktop applications. There is a difference, however - integrated Intel graphics use much less power than NVIDIA graphics. By using the low-power onboard graphics when a high-power dedicated graphics card isn’t necessary, laptops can save power and increase battery life.
    When you launch an application that needs high-powered 3D graphics, such as a PC game, the laptop powers on the NVIDIA graphics hardware and uses it to run the application. This increases 3D performance dramatically, but takes more power - which is fine if your laptop is plugged into an outlet.
    When you go to Control Panel > Hardware and Sound > Device Manager > Display Adapters there you can see the two GPU's.
    The problem is that eclipse is run with the Intel GPU, which for me had Opengl version 3.1.
    When doing:
    Display.create();
    String version = GL11.glGetString(GL11.GL_VERSION);
    System.out.println(version);
    I get " 3.1.0 - Build 9.17.10.2932"
    To make your pc use the NVIDIA GPU for Eclipse, go to Control Panel > Hardware and Sound > NVIDIA Control Panel > Manage 3D Settings:
    Option1: Either change "Preferred graphics processor" to "High-performance NVIDIA processor" to make your laptop always use the NVIDIA GPU.
    Option2: OR go to program settings > add > select the eclipse.exe in your eclipse installation folder and change "Preferred graphics processor" to "High-performance NVIDIA processor".
    Now I had a problem where the second option to only apply it for eclipse is not applied for some weird reason, so I just made my laptop use my NVIDIA GPU all the time. If you really don't want to do that you can right click the eclipse.exe and choose "Run with graphics processor" option. If anyone finds out why the second option does not work please tell me.
    When doing:
    Display.create();
    String version = GL11.glGetString(GL11.GL_VERSION);
    System.out.println(version);
    I get "4.4.0 NVIDIA 344.48", you should now be able to make a new ContextAttribs(3, 2) without a problem.

    • @ivanenzhaev2373
      @ivanenzhaev2373 5 років тому

      I will show how to solve this problem if you use C++ and Windows. You can add these lines at the beginning of your main.cpp file. One line is for NVIDIA Geforce and another line is for AMD Radeon. After this your Exe file will use "High-performance NVIDIA processor" always.
      #include
      extern "C" _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
      extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001;

  • @robatortas_
    @robatortas_ 3 роки тому +2

    hey, can someone help?
    I dont really know why this happens...
    Code:
    package renderEngine;
    import org.lwjgl.LWJGLException;
    import org.lwjgl.opengl.ContextAttribs;
    import org.lwjgl.opengl.Display;
    import org.lwjgl.opengl.DisplayMode;
    import org.lwjgl.opengl.GL11;
    import org.lwjgl.opengl.PixelFormat;
    public class DisplayManager {

    private static final int WIDTH = 1280;
    private static final int HEIGHT = 720;
    private static final int FPS_CAP = 120;


    public static void createDisplay() {

    ContextAttribs attribs = new ContextAttribs(3,2);
    attribs.withForwardCompatible(true);
    attribs.withProfileCore(true);

    try {
    Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
    Display.create(new PixelFormat(), attribs);
    Display.setTitle("JGame WIN");
    } catch (LWJGLException e) {
    e.printStackTrace();
    }


    GL11.glViewport(0, 0, WIDTH, HEIGHT);

    }
    public static void updateDisplay() {

    Display.sync(FPS_CAP);
    Display.update();

    }
    public static void closeDisplay() {

    Display.destroy();

    }
    }
    Error:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
    at engineTester.MainGameLoop.main(MainGameLoop.java:14)
    Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 1 more

  • @StephanoGames
    @StephanoGames 10 років тому +18

    Great job. I have no almost no prior java game coding knowledge, but so far this strongly motivates me to learn java. Also, you do a great job explaining so do understand this, even without knowing java, very well. Keep up the great work!

    • @frempass3309
      @frempass3309 2 роки тому

      I know this is 7 years old but your real lucky I got many issues and I got out of ONE issue but got another one but good tutorial..

  • @FaizaanDatoo
    @FaizaanDatoo 9 років тому +9

    Mac users: In the closeDisplay method in the DisplayManager class, remember to add a System.exit(0); just after Display.destroy(). If you do not do this, the display will linger and just be annoying.

  • @VoylinsLife
    @VoylinsLife 3 роки тому +9

    I recently started wondering if I would make a game engine just to have a better understanding of them. I always thought that you were awesome for always coding everything yourself. Yesterday I found your series, it may be a couple of years old but I'll still follow through everything ^^
    Thank you for sharing your knowledge!

  • @ItzAyan_
    @ItzAyan_ 4 роки тому +2

    Hello if you get this error
    at renderEngine.DisplayManager.createDisplay(DisplayManager.java:17)
    at engineTester.MainGameLoop.main(MainGameLoop.java:11)
    Caused by: java.lang.ClassNotFoundException: org.lwjgl.opengl.DisplayMode
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    then it means that in your eclipse in your project name the version is supposed to be javaSE-1.7
    for me that worked on my mac

  • @frank34443
    @frank34443 8 років тому +7

    Hello! This is exactly the type of tutorial I would be incredibly interested in. However, before diving in, I wanted to ask if this is completely dependent on Java? I would much rather do all of this in C++!

    • @ThinMatrix
      @ThinMatrix  8 років тому +10

      +Frank Botos The majority of the code is OpenGL calls and GLSL shader code, which is pretty much the same in any language. The only big differences will be setting up the display and handling user inputs. I know that quite a few people have followed this tutorial series all the way through using C++.

    • @frank34443
      @frank34443 8 років тому +1

      Okay awesome! As long as it's stuff like mouse/keyboard input and window creation I believe I can figure that part out. Thanks a lot for sharing this knowledge, I am looking forward to learning!

  • @travelistic3558
    @travelistic3558 5 років тому +2

    First I had a weird red flickering of the game window. Solution was to insert glClear(GL_COLOR_BUFFER_BIT); in the while loop.

    • @docodemo727
      @docodemo727 4 роки тому +1

      Could you explain what does it do?

    • @irissupercoolsy
      @irissupercoolsy 3 роки тому

      what does it do? And the method doesn't exist :(

  • @inferno1176
    @inferno1176 2 роки тому +2

    I got an error saying this:
    'Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
    at engineTester.MainGameLoop.main(MainGameLoop.java:11)
    Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
    ... 1 more'
    What do I do?

    • @boulhemachraf873
      @boulhemachraf873 2 роки тому +1

      @DybaTubeMusic make sure to add the library in the classPath of your project

    • @alonepoptart24_6
      @alonepoptart24_6 4 місяці тому

      @@boulhemachraf873 GOD BLESS YOU

  • @gosnooky
    @gosnooky 5 років тому +10

    Didn't think anyone who wasn't Indian used Eclipse with a light theme.

    • @voxelrifts
      @voxelrifts 5 років тому +3

      Any Problems with Indians?

  • @sumgamelab
    @sumgamelab 20 днів тому +2

    If you get the error "The type org.lwjgl.opengl.Display is not accessible" then go to the GameEngine folder -> open src folder -> delete module-info -> go back to eclipse and refresh project.
    If you get stuck with "new DisplayMode(WIDTH,HEIGHT)" asking for 2 extra parameters -> remove the line "import java.awt.DisplayMode;" -> replace line with "import org.lwjgl.opengl.DisplayMode;", confusingly the opengl package used the same class name as awt package so you can accidently import the wrong one. If you used the ctrl + shift + o hotkey in eclipse you will import the wrong one as default

  • @roninyasuo4301
    @roninyasuo4301 3 роки тому +1

    LWJGL seems to have "deprecated" the Display class. Now, I'm not even sure how to start the tutorial.

  • @raven9057
    @raven9057 9 років тому +3

    With people getting errors with unsatisfiedLinkError, right click on the JRE System Library in the package Explorer (assuming your using eclipse) - build path -> configure build path then double click on the native library location, that will bring up an explorer window and just point it to your lwjgl -> natives -> windows. it did the trick for me. i'm using version 2.9.2. hope that helps.

  • @JRDev4All
    @JRDev4All 6 років тому +3

    When I do this on my Mac, the code executes, but I get a red and black flashing screen. How do I fix this?

  • @SebastianSeth
    @SebastianSeth 3 роки тому +1

    the LWJGLException class is missing

  • @dondurruti6317
    @dondurruti6317 8 років тому +7

    Wow, I'm amazed. For the 1st time ever, somthing showed in a programming tutorial I watched, works instantly without any errors xD
    I'm getting better at this!

  • @MaxGamingAwesome
    @MaxGamingAwesome 3 місяці тому +1

    ThinMatrix: lets make a tutorial that shows people how to make a 3d world in Java!
    90% of people: MINECRAFT

  • @MohammedPlaysMC
    @MohammedPlaysMC 10 років тому +4

    Wait a second did u say by the time you get to tutorial 25 we will have terrain gen, lighting, 3rd person player, fog, skybox, multipul light sources and multiplayer ok this is way to much you are the best UA-camr ever it normally takes people 100 episodes just to set up a terrain :D

    • @10goni
      @10goni 7 років тому

      Mohammed Qureshi other people eplain stuff

  • @code_red_master
    @code_red_master 4 місяці тому +1

    "이 강의가 없었다면 지금의 나는 없었다"
    본질에 매우 충실한 강의.
    대학생 시절, 컴퓨터공학을 전공했지만 늘 자신감이 없었던 나에게
    엄청난 실력과 압도적인 자신감을 가져다준 유일한 강의입니다.

  • @Zharkan16
    @Zharkan16 10 років тому +7

    This is awesome, thanks for this, I will totally try to follow it :)

  • @DanielHong35
    @DanielHong35 8 років тому +5

    I really appreciate you zooming into your code as you walk us through. Thank you very much for doing that!

  • @adrianciotinga8718
    @adrianciotinga8718 6 років тому +6

    doing this tutorial on Scratch.MIT.edu right now. Tried Java and c++ but found them both far too limiting.

    • @lilcatfriend4575
      @lilcatfriend4575 6 років тому

      Lol

    • @HunterD510
      @HunterD510 5 років тому +1

      Java and C++ limiting when compared to scratch? Are you trolling?

    • @minsin56
      @minsin56 5 років тому

      thats what c# is for

    • @ryanwilson5079
      @ryanwilson5079 5 років тому

      try assembly and machine language

    • @HunterD510
      @HunterD510 5 років тому

      @@ryanwilson5079 Hard to read but not really limiting as if you're good enough you could build any C++ program in machine or asm. Would take forever though and good luck reading it lol

  • @chenrone935
    @chenrone935 3 роки тому +1

    I have this problem "Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path" and the solution is put lwjgl64.dll under C:\Program Files\java\jdk…

  • @matdev4788
    @matdev4788 6 років тому +6

    It's works! The like button works!

  • @craigosborne3812
    @craigosborne3812 3 роки тому +1

    it seems that version of lwjgl doesn't work for some, the 2.9.3 version should work if you have problems: sourceforge.net/projects/java-game-lib/files/Official%20Releases/LWJGL%202.9.3/

  • @nullerino
    @nullerino 10 років тому +7

    Just finished watching the whole video and thought it was great (I've only done simple pure java games), definitely can't wait for the next episode! Great job man

  • @DudeInaScarf
    @DudeInaScarf 10 років тому +4

    Great, thanks for tutorial!!! And good luck with your multiplayer game.

  • @riteshpatidar9184
    @riteshpatidar9184 4 роки тому +2

    Don't get demotivated when you see Unity's logo.. You are here bcoz you love the whole process of programming, not just results😃

  • @DemonicGaming15
    @DemonicGaming15 10 років тому +8

    YES! It's finally here, thank you so much for doing a tutorial series. It will benefit me so much, thanks!

  • @Xizilqou
    @Xizilqou Рік тому +2

    Is it possible to do this in a language that isn't java

  • @ojaslandge515
    @ojaslandge515 6 років тому +5

    Doing these tutorials in c++ now. Got through the first 40 episodes before but now I feel like java isn't the encouraged language to make a game in because of the speed. Java is still my favorite language and I love these tutorials.

    • @gravedigger7380
      @gravedigger7380 6 років тому

      I'd assume you're using GLFW instead, but I was curious to if I should be using c++ over java.

    • @eksdeeksde2854
      @eksdeeksde2854 6 років тому +1

      @@gravedigger7380 I don't think it's so hard to transform the code from Java to C++ cuz the opengl is basically the same and the steps are the same too. I think you just need a lil bit of logic :3

    • @gravedigger7380
      @gravedigger7380 6 років тому

      Good to know, thank you. :)

  • @hypnagogic8028
    @hypnagogic8028 5 років тому +1

    Hello, I am having trouble with the import statements. When I write import org.lwjgl.LWJGLException I get the error: the package org.lwjgl is accessible from more than one module lwjgl, lwjgl.util.

  • @wendelsantos3399
    @wendelsantos3399 3 роки тому +3

    I tried, and got the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
    at engineTester.MainGameLoop.main(MainGameLoop.java:20)
    Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 1 more
    I'm using java-11-openjdk.

  • @カラスKarasu
    @カラスKarasu 9 років тому +5

    For those of you that get the "Could not create openGL context" error, call the Display.create() function with no parameters, then call GL11.glGetString(GL11.GL_VERSION); This will give you a string with your opengl version. You might not support opengl v3.2

    • @augczr
      @augczr 9 років тому

      カラス I'm getting this error but couldn't figure out how to fix it.
      However, the window opens just fine, with no errors, if I use Display.create(), with no parameters, instead of the PixelFormat and attribs version of it.
      I'm using a Linux Ubuntu 64bit, from a laptop (onboard videocard), if that information is useful.

    • @カラスKarasu
      @カラスKarasu 9 років тому

      *****
      You have 4.5
      353.30 is the version of your NVIDIA drivers.

    • @MrCimik
      @MrCimik 7 років тому

      Thanks for that advise.

  • @astarrobotics
    @astarrobotics 5 років тому +2

    Don't know if you still read the comments, but I was wondering if this is still relevant? It seems like the best tutorial on UA-cam. Should I stick with lwjgl 2 or go to lwjgl 3? What are the benefits of one versus the other?

    • @Simon-ik1kb
      @Simon-ik1kb 5 років тому

      yeah, you are not alone, i wonder the same myself :)

    • @profiluefter
      @profiluefter 5 років тому

      Try to follow it with lwjgl 3. I did this a while ago and besides from the first or maybe also second episode it works farely well
      Edit: Some resources: github.com/LWJGL/lwjgl3-wiki/wiki/2.6.6-LWJGL3-migration github.com/JOML-CI/JOML/wiki/Migrating-from-LWJGL-2

    • @astarrobotics
      @astarrobotics 5 років тому

      @@profiluefter Thank you very much. I will stick with LWJGL 2 for now because I am a noob at this, but I might switch over later. With exams and everything lately, I am only on episode 10 or so ;)

  • @borabulan435
    @borabulan435 6 років тому +1

    Hello ThinMatrix can you please help me it always gives the same error
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    The constructor ContextAttribs(int, int) is undefined
    The method withForwardCompatible(boolean) is undefined for the type ContextAttribs
    at renderEngine.DisplayManager.createDisplay(DisplayManager.java:19)
    at engineTester.MainGameLoop.main(MainGameLoop.java:15)

  • @DenverWilliam
    @DenverWilliam 4 роки тому +1

    I love these tutorials, I just wish that so much had not changed from then until now. I mean, I could always downgrade the programs to backtrack to this time, but would that affect dramatically the quality capable from LWJGL3 and Java 14?

  • @robbeandredstone7344
    @robbeandredstone7344 6 років тому +2

    Actualy, just a question becaus I am thinking about working with networking in java. Which library did you juse in Socuwan to do the Server and Client stuff or did you do it with the java inbuilt functions?

    • @ThinMatrix
      @ThinMatrix  6 років тому +1

      I just used stuff from the Java standard library.

  • @diviiniity6529
    @diviiniity6529 5 років тому +2

    In my console it leaves a message saying ‘Exception in thread ‘main’ java.lang.NoClassDefFoundError: sun/misc/Unsafe’ with then a bunch if lines starting with ‘at’

    • @nehr-dv6ye
      @nehr-dv6ye 5 років тому +1

      Could be a problem with jar and/or native linking. I had a similar exception then I messed around with my jars and natives until I fixed it.

    • @hippiedonut1
      @hippiedonut1 5 років тому

      @@nehr-dv6ye I'm getting the same issue on macOS, but my display will open and then close soon after. I checked that my jars/natives were linked correctly.

    • @nehr-dv6ye
      @nehr-dv6ye 5 років тому +1

      @@hippiedonut1 I've done this tutorial twice so far and both times I got this error and solved it by changing the jar and native linking. I think the error means that java is able to find the class definition during compile time but not during runtime. The first time I did this I was not using a module and ended up putting everything into the classpath. The second time I tried using modules but it refused to work for me no matter what I did so I just deleted the module info and moved everything back to the classpath. I'm using windows so I'm not 100% sure what you do on macOS but I think you need a folder in your lib folder called "macosx" with "libjinput-osx.dylib"; "liblwjgl.dylib"; and "openal.dylib" in it. Then in your build path under classpath under each of the jars you need to set your native library location to the macosx folder. That's kind of how I've got mine set up at the moment but with a windows folder instead of a macosx folder.

    • @hippiedonut1
      @hippiedonut1 5 років тому +2

      @@nehr-dv6ye Thanks a lot for the quick response. I just spent 2 hours on this so hopefully this comment helps someone. I spent a lot of time checking if the problem was the JRE version, but it wasn't. At least on macOS, a variant on what n17e said worked for me. Right-click the project (GameEngine), then do Build Path -> Configure Build Path, then drag the 3 jar files from under "Modulepath" to under "Classpath". Then, you might need to click on the JRE System Library in the same window, then click Edit... and select your JRE again. If one doesn't work, try another. I didn't need to make a "macosx" folder at all.
      Here's what it should look like at the end: i.imgur.com/le60GAC.png
      Thanks n17e and hope this helps someone else.

    • @therealmemernet
      @therealmemernet 5 років тому

      @@nehr-dv6ye thanks so much, you helped me a lot

  • @titusboudreaux
    @titusboudreaux 8 років тому +1

    You are so fast, I put you in 0.5 speed. LOL!

  • @quinn4571
    @quinn4571 4 роки тому +1

    Can you still follow this tutorial if you use c++

  • @hyperxplays
    @hyperxplays 5 років тому +1

    THIS HAS RUN ERRORS ON MAC WHEN ALL THE CODE HAS NO CROSSES ANYONE HELP!

    • @dr4kk0nnys6
      @dr4kk0nnys6 5 років тому

      hey bro ! I don't know if you already fixed, but give it a shot ->
      glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
      glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
      glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
      glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
      Paste this at the beggining of the GLFW file

  • @slaycorezz823
    @slaycorezz823 4 роки тому +1

    not working errors

  • @MongoolGaming
    @MongoolGaming 4 роки тому +1

    import org.lwjgl.opengl.Display;
    this doest work

    • @tttyyy4200
      @tttyyy4200 4 роки тому

      Hey, I think I had the same issue and here is how I solved it: I downloaded LWJGL 2.9.3 instead of the one linked in the setup tutorial video and I also made sure I was using Java 8 while creating a new project. Hope this helps. Good luck

  • @sutoreikyatto
    @sutoreikyatto 5 років тому +1

    someone help me please, for some reason my window is not opening. When i click run on eclipse, it replies with editor does not contain a main type.
    someone help pleeez

  • @giovannarozentinunes4566
    @giovannarozentinunes4566 2 роки тому +1

    So thankful for this

  • @have821
    @have821 6 років тому +1

    I have a problem. When I do "import org.lwjgl.LWJGLException;", the "org.lwjgl" is underlined red, and it says "The package org.lwjgl is accessible from more than one module: lwjgl, lwjgl.util". It causes a problem if I run the MainGameLoop.java.
    Can I get some help?
    Thanks

    • @have821
      @have821 6 років тому

      Here is the error I get when I run the program:
      Exception in thread "main" java.lang.Error: Unresolved compilation problem:
      LWJGLException cannot be resolved to a type
      at renderEngine.DisplayManager.createDisplay(DisplayManager.java:26)
      at engineTester.MainGameLoop.main(MainGameLoop.java:11)

    • @tristonlees6021
      @tristonlees6021 5 років тому

      I had the same issue. You have probably fixed it by now, but if you still need help:
      The issue for me was when I added the jar files under buildpath>libraries I needed to click on the classpath instead of Modulepath. That is not the way it appears in the video, maybe because we are using a newer version of eclipse.

  • @rajabakh2196
    @rajabakh2196 2 роки тому +1

    Thanks, really helped

  • @galsk2533
    @galsk2533 7 років тому +1

    LOL this is my 4th time watching this series because I am trying to learn it rather than just copying it. I want to be a software engineer or developer when I go to university. Cheers!

  • @liskov7983
    @liskov7983 3 роки тому +2

    Can I follow the series translating it to C++?

    • @nialyavuzturk379
      @nialyavuzturk379 3 роки тому

      I don't think so because it uses opengl which works with c++ but it also uses lwjgl which you can't use in c++

    • @liskov7983
      @liskov7983 3 роки тому

      @@nialyavuzturk379 Yeah I just thought it's going to be very similar. I currently learn Java and I know some (maybe intermediate..) C++. Thanks for the answer.

    • @nialyavuzturk379
      @nialyavuzturk379 3 роки тому

      @@liskov7983 No problem

  • @nilocallen
    @nilocallen 10 років тому +2

    Thank you so much for doing this again. It was so awesome :D PLEASE don't stop this mid way like most people. You're a great guy :)

    • @ThinMatrix
      @ThinMatrix  10 років тому +1

      Colin Allen Thanks! I'll do my best :)

  • @icedlemontea9922
    @icedlemontea9922 7 років тому +1

    if you get the UnsatisfiedLinkError in Netbeans, go to File>Project Properties>Run>Type into VM Options: -Djava.library.path=(location of the natives folder)

  • @sanzidaluna8027
    @sanzidaluna8027 5 років тому +1

    "org.lwjgl.LWJGLException: Pixel format not accelerated..."
    constantly getting this error.Please someone help. I am not using any graphics card.

    • @sbonelomsibi2955
      @sbonelomsibi2955 5 років тому

      I have the same problem

    • @sanzidaluna8027
      @sanzidaluna8027 5 років тому

      I just shifted my code from lappy to desktop and all worked fine. My desktop has the same setup as lappy. Still dont know why it didn't work for lappy.

  • @michaellvoltare
    @michaellvoltare 10 років тому +2

    thanks a lot for taking the time to do this even though you we know you are so busy working on your game :)

  • @droptherapy2085
    @droptherapy2085 6 років тому +1

    Does the version of the IDE matter? I am using the latest version of eclipse and am wondering if that changes anything with the syntax itself or if it's just improving the interface.

    • @lilcatfriend4575
      @lilcatfriend4575 6 років тому

      No, it does not matter.

    • @droptherapy2085
      @droptherapy2085 6 років тому

      Wow, that comment seems SO MUCH OLDER than 3 weeks old.

    • @lilcatfriend4575
      @lilcatfriend4575 6 років тому

      Lol.

    • @droptherapy2085
      @droptherapy2085 6 років тому

      I was asking because the unity C# code constantly changing syntax has bothered me for years.

    • @lilcatfriend4575
      @lilcatfriend4575 6 років тому

      Oh yeah, I know how that feels I like programming in C# too, and it does get crazy when they change something.

  • @michalbenes1718
    @michalbenes1718 Рік тому +1

    How I can set the window to fullscreen mode?

    • @ThinMatrix
      @ThinMatrix  Рік тому +5

      You can try this:
      DisplayMode[] modes = Display.getAvailableDisplayModes();
      for (int i = 0; i < modes.length; i++)
      {
      if (modes[i].getWidth() == width
      && modes[i].getHeight() == height
      && modes[i].isFullscreenCapable())
      {
      Display.setDisplayModeAndFullscreen(modes[i]);
      }
      }

    • @kumatoons5508
      @kumatoons5508 Рік тому +5

      @@ThinMatrix still replying after 8 years lol

  • @NoVIcE_Source
    @NoVIcE_Source 2 місяці тому

    Nostalgia!!!! :D

  • @look3248
    @look3248 7 років тому +2

    What do the withForwardCompatable and withProfileCore technically do? Just wondering bc on another tutorial they just used create();

    • @jacobpeterson2339
      @jacobpeterson2339 7 років тому +1

      withForwardCompatable means that this program is, obviously, forward compatible, meaning if there is a computer that uses a higher version of OpenGL, this program will be able to run on it. The core profile is slightly more complex, but essentially the core profile is modern OpenGL structure, apart from the previous fixed pipeline structure

    • @Romejanic
      @Romejanic 7 років тому +1

      Just using create() without context attribs will use the legacy fixed function version of OpenGL (< 2.1). withForwardCompatible will make it forwards compatible with future OpenGL versions (> 3.2) and withProfileCore uses the new, core OpenGL profile rather than fixed function.

  • @corriedotdev
    @corriedotdev 3 роки тому +1

    hype man

  • @jasonbenner7055
    @jasonbenner7055 5 років тому +1

    Hey if you guys are having any issues with a sun.misc.Unsafe error just go into your module-info.java file and add in "requires jdk.unsupported"

    • @WizardNamedMerlin
      @WizardNamedMerlin 4 роки тому

      After hours of hair tugging, this one comment saved me. Thank you so much.

  • @funkeymonkeyedc
    @funkeymonkeyedc 10 років тому

    the while loop didnt work for me so i changed it to this
    while(Display.isActive()) {
    if(Display.isCloseRequested()) {
    Display_Manager.closeDisplay();
    }
    //gamelogic (Update/tick)
    //render
    Display_Manager.updateDisplay();
    }

  • @zzzzzzzzzzzzzzzzz161
    @zzzzzzzzzzzzzzzzz161 6 років тому +1

    Woah, si j'arrive à m'accrocher à ce tutoriel je vais en apprendre plus sur Java et la création d'un jeu 3D que je ne l'aurais jamais imaginé ! Wonderful and brilliant, you just speak a little bit fast but that's really nothing, i can keep up the pace :D . Great work !

  • @edilonjunior782
    @edilonjunior782 5 років тому +1

    Please update to lwjgl 3.

  • @ezalb9893
    @ezalb9893 3 роки тому +1

    hi
    can i use this tutorial in 2021 or is it too old?

  • @wissamnusair6000
    @wissamnusair6000 4 роки тому

    please help
    java.lang.ClassNotFoundException

  • @ivanenzhaev2373
    @ivanenzhaev2373 5 років тому

    I will rewrite the code to TypeScript and WebGL 1.0. The result: 8observer8.github.io/WebGL/thin-matrix-engine-tutorial/index.html

  • @debroy6680
    @debroy6680 7 років тому

    if you have the following error : org.lwjgl.LWJGLException: Could not create context (WGL_ARB_create_context)
    then try the code below at DisplayManager.java file :
    package renderEngine;
    import org.lwjgl.LWJGLException;
    import org.lwjgl.opengl.ContextAttribs;
    import org.lwjgl.opengl.Display;
    import org.lwjgl.opengl.DisplayMode;
    import org.lwjgl.opengl.GL11;
    import org.lwjgl.opengl.PixelFormat;
    public class DisplayManager {
    private static final int WIDTH = 500;
    private static final int HEIGHT = 500;
    private static final int FPS_CAP = 120;
    public static void createDisplay(){
    //ContextAttribs attribs = new ContextAttribs(3,0).withForwardCompatible(true).withProfileCore(true);
    //ContextAttribs attribs = new ContextAttribs();
    //attribs.withForwardCompatible(true);
    //attribs.withProfileCore(true);
    try {
    Display.setDisplayMode(new DisplayMode(WIDTH,HEIGHT));
    Display.create(new PixelFormat());
    } catch (LWJGLException e) {
    e.printStackTrace();
    }
    GL11.glViewport(0,0,WIDTH,HEIGHT);
    }
    public static void updateDisplay(){
    Display.sync(FPS_CAP);
    Display.update();
    }
    public static void closeDisplay(){
    Display.destroy();
    }
    }
    thank you .

  • @nwb3
    @nwb3 4 роки тому

    @ThinMatrix Which video does the multiplayer stuff?

  • @madhurdagar42
    @madhurdagar42 7 років тому

    Exception in thread "main" java.lang.IllegalArgumentException: Profiles are only supported on OpenGL version 3.2 or higher.
    at org.lwjgl.opengl.ContextAttribs.withProfileCore(ContextAttribs.java:188)
    at renderEngine.displayManeger.createDisplay(displayManeger.java:25)
    at engineTester.MainGameLoop.main(MainGameLoop.java:12)
    This error comes whenever I run the game . Plz help me.

  • @c56edfrq
    @c56edfrq 6 років тому

    Can i change 3, 4 to: ContextAttribs attribs = *new ContextAttribs(1, 4)* .withForwardCompatible(true).withProfileCore(true);

  • @avatar098
    @avatar098 4 роки тому

    For those following along in 2020,
    Display has been deprecated: stackoverflow.com/a/28525313/2887274

  • @taljune142010
    @taljune142010 4 роки тому

    Hello ThinkMatrix, Is there a way to send a link for downloading LWJGL 2?

  • @shanaranna3293
    @shanaranna3293 9 років тому

    Okay, so blah this and blah that... I never thought making a game would be hard =w=) especially if it's 3D T.T), I was just in the mood to make a 3D game... Yet it's so hard... BTW! Does anyone know or played the game, or anime, SAO? Or Soul Worker? I want to be my game like that, it's graphic's I mean... Is it really hard for a graphic in-game to be like that?

  • @krunkster
    @krunkster 3 роки тому

    Hello I get this error and my code is the same as yours please help. Error: Could not find or load main class engineTester.MainGameLoop
    Caused by: java.lang.ClassNotFoundException: engineTester.MainGameLoop

  • @voiceinthevoid14
    @voiceinthevoid14 8 років тому +1

    1,234th liker :)

  • @verypnk2203
    @verypnk2203 7 років тому

    Can i get code from somewhere? I don't want to *copy* and *paste* the code all over my project's... That's not good for m8. (Sorrry for bad english, i'm from poland *XD*)

  • @SammySylvester
    @SammySylvester 5 років тому

    If you remove the parameters from the Display.create() method and still doesn't work, check out the error log to solve the problem: in my case I had to comment out the following line: //attribs.withProfileCore(true); .