Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

702 Good

About axel1994

  • Rank

Personal Information

  1. You don't seem to know how finally works: See the Java code below. Your code would not execute the finally. However in Java it will execute the finally. Finally is always called in Java unless you: Call system.exit() Another thread interrupts this one The JVM crashes Ofcourse a C++ finally needs to mirror this. public class Main { public static void main(String args[]) { something(); } public static int something() { int success = 1; int failure = -1; try { exceptionthrower(); return success; } catch (Exception e) { return failure; } finally { System.out.println("Will always be printed"); } System.out.println("Wil never be printed"); } public static void exceptionthrower() throws Exception { throw new Exception(); } }
  2. This is not the point of this discussion.   Whatever way you look at it. Having a degree is an advantage.   It's not necessary but it's an advantage.
  3. axel1994

    Where do I go next?

    Sorry, I wasn't meaning to refer to it as a language, I was simply meaning that I could do it using the library, however I was trying to say that I was unsure about starting to learn and do those things in other languages, such as c#.   Anyone can say that they can do something. But there is a big difference between thinking you can do it and actually doing it.   I might actually believe I can do something. But that doesn't mean anything. It doesn't give the experience you get from actually doing it.
  4. axel1994

    Pure Java or LWJGL?

    Didn't see the date 
  5. axel1994

    Have you made a game engine

    May I ask what feature this is? (that doesn't exist enywhere else)
  6. axel1994


    this depends on where you start from.   If you start from scratch, you'll need more math, than when you are going to use an engine.   Aren't most engine programmers and such (in the actual industry) engineers and computer scientists?
  7. axel1994

    OpenGL Drawing texture problem

    Ow, damn Thank you so much.   Can't believe I spend 2 days looking for that. Now It works perfectly.   I now found that the order of texture coordinates should be 0,1,2,3. Now the image shows amazing.   It works great along with the camera
  8. Hello,   I got a problem when I'm trying to draw a texture on a object (a rectangle in this case) I don't think there is any problem in the shaders, but I'll give them either way. Vertex shader: #version 330 layout (location=0) in vec3 position; layout (location=1) in vec2 uvcoor0; out vec2 uvcoor; void main() { gl_Position = vec4(position, 1.0); uvcoor = uvcoor0; } Fragment shader: #version 330 uniform sampler2D tex; in vec2 uvcoor; void main() { gl_FragColor = texture2D(tex, uvcoor.st); } The code I'm using: For the uv buffer here I have an struct where I store the length and the actual uv coordinates texturecoor.len = 4; Vector2f vec; texturecoor.texcor = new Vector2f[4]; vec.x = 1; vec.y = 1; texturecoor.texcor[0] = vec; vec.x = 0; vec.y = 1; texturecoor.texcor[1] = vec; vec.x = 1; vec.y = 0; texturecoor.texcor[3] = vec; vec.x = 0; vec.y = 0; texturecoor.texcor[2] = vec; The vertex and index coordinates are located in an .obj file that I load. That works correctly (since I can draw the rect with a color instead of a texture. Here is the obj file, The index int are read in the exact same order. Each vertex line is in xyz # Blender v2.69 (sub 0) OBJ File: '' # www.blender.org o Plane v 1.000000 1.000000 0.000000 v -1.000000 1.000000 0.000000 v 1.000000 -1.000000 0.000000 v -1.000000 -1.000000 0.000000 f 2 3 0 f 1 0 3 Loading the texture I use: str is the relative path, load_image returns an image object that stores the width, height and data GLuint texture; image img = load_image(str); glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glTexImage2D(GL_TEXTURE_2D,0, GL_RGB, img.width, img.height, 0, GL_BGRA, GL_UNSIGNED_BYTE, img.data); destroyImg(img); return texture; loading everything into opengl I use the code: (this is after I loaded all data in the buffers) but for reference, here is my loading of my uvbuffer (ttx is the data of the uv coordinates) glGenBuffers(1, &uvbuffer); glBindBuffer(GL_ARRAY_BUFFER, uvbuffer); glBufferData(GL_ARRAY_BUFFER,sizeof(ttx), ttx, GL_DYNAMIC_DRAW); glGenVertexArrays(1,&vao); glBindVertexArray(vao); glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0); if (uv) { glBindBuffer(GL_ARRAY_BUFFER, uvbuffer); glEnableVertexAttribArray(1); glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, 0); } glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexbuffer); glBindVertexArray(0); When rendering I bind the texture, bind the vao and draw all triangles: (nbElem is the number of index elements) glActiveTexture(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); //bind the vao (didnt copy that line of code) glDrawElements(GL_TRIANGLES, nbElem, GL_UNSIGNED_INT, 0); The included pictures are: the image I load in the image resulting on the screen (I got the image from some examples pictures that came with the image loading lib I'm using)   It's not correct, but it also draws the image twice. Once normally and once turned 90 degrees   what I've tried doing is, changing the texture coordinates order. But the order I have now (0,1,3,2) gives the best result.   I also have a world matrix to represent a camera. I multiple this camera with only the vertices (not with the uv coordinates)   Even without using the camera, I get exactly the same result. Another issue, which I believe is part of this problem.   If I zoom out with my camera, the texture changes. The more zoomed out, the more correct the image is displaying.   I did check the camera. But without a texture the camera works perfectly.   My apologies if I didn't include enough information.   [attachment=19229:img_cheryl.jpg] [attachment=19230:tex.png]
  9. axel1994

    What should I start with ?

    Opengl is cross platform so It'll work on every system. (the available version is different, windows can use the highest version)   DirectX is the other choice, is windows specific. It's mostly a matter of taste
  10. axel1994

    Creating an Open World game

    Nobody said that it's impossible. It's just not practical. The art, the programming, it's too much.   Sure, you can make a great game in 3 years. But it won' t be the equivalent of an AAA game. (maybe an AAA game from a decade ago, but we are considering AAA games from today, not gta 3 or Doom (which I would consider AAA))   Implying otherwise is egoistical. (sort of) Why? Because that would imply that that person could do the exact same amount of work in the same time as hunderds of people from a big company.   So you think, sure I'll just work for 10-15 years. You'll need amazing motivation (and money, since where are you going to get money to eat?) to do that and finish the project. But the work done today is old news in 15 years time.   AAA isn't better than indie. Games don't need to be like that to be good.   The reason why I started this discussion is that having unrealistic expectations isn't good. I think many people (everyone?) have a dream game, which would require it to be AAA. But most people know that it's that, a dream. (something that could happen, but probably not)   Your original post made it look like you could expect to be someday possible to make an AAA game on your own. Which is just not true (if it is, there would be many people who already did it)
  11. axel1994

    Creating an Open World game

    You do know that COD and assasin creed are AAA games created by studios (hunderds of very experienced people)?   Beginners already often have a surreal look on games. Your post makes it look like it's easy (or even doable) for 1 person to achieve something like this.   I'm not saying indies can't make great games, nor that extremely talented people couldn't create something close to AAA. I'm just saying, you should stay realistic.   Next, there is no best language. C++ is a choice, not THE only choice (ofcource if you want in the business, then you should know it) As a beginner you shouldn't really look at what is the fastest. Being able to take advantage of the actual speed, already takes an experienced programmer. Do note: I'm not saying you're wrong in any way. I'm prefer C++ myself.
  12. axel1994

    OpenGL Opengl Linux

    Thanks for all the responses     I'm using debian weezy. And yes, I tried to install manually. (so bad) Somehow I messed up my whole system. Everything was broken, I could barely login (even through recovery mode)   I had to reinstall the system.   I'm searching around the web how I could install the drivers. But each time I try something, x won't run.
  13. So, this is a pretty dumb question.   But how do I get Opengl 3.3+ running on linux.   Atm glxinfo gives me the info: 3.0 Mesa 8.0.5 My graphics driver is Nvidia geforce GT 630M (2GB)   I've tried (and still am trying) to get Mesa 9.2.3 running. I've got problems installing it.   I do know that Mesa 10 will be released quite soon, which supports 3.3. But there have to be different options.   I also found the linux x64 (amd64/em64t) display driver on Nvidia website. But I don't know whether it supports opengl 3.3+   What I do know is that on my windows partition I got opengl 4.0 running.
  14. axel1994

    New to Java first project.

    You should have a file on your pc named Magamar.java In that file should be the code you wrote in the first post.   Then in the command line you go to the folder that holds the file Magamar.java Then you type: javac Magamar.java (this will generate a Magamar.class file) Then you type: java Magamar
  15. axel1994

    New to Java first project.

    The file name needs to be Magamar.java
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!