Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actual0r0d

Posted 01 January 2013 - 02:22 PM

Hey there, I've been programming in Java for 2 years and I've recently gotten hold of a NVidia GTX 660. I want to work on my own 3D rendering program but I have no idea how to draw 2D Images to the screen in C++. I know how to do it in Java but C++ looks a little bit more complicated when it comes to making windows. 

I'm using Ubuntu 12.10 64-bit and using NVidia's nvcc compiler which uses gcc and g++.

All I want to do is draw a 2D image to the screen. No GUI, no window borders, just an image.

One idea I had was to set up a socket connection between a C++ app and a Java app which sends the pixel data over my computer to the Java app which displays the image but I think that may be a bit slow (I have no idea).

Is there a way to do this without any external libraries? Can I do this with just the gcc and g++ includes?

Any help is appreciated and I'll give +1 rep for any helpful answers.

 

Wait, do you want to work on a 3D rendering program, or just a 2D one where you directly set each pixel of an image and then just draw that to the screen?

 

I recommend you find some simple OpenGL tutorials online and then start playing around with setting up OGL and drawing some simple shapes to the screen.  Then you can texture them.  (at that point you can get a pointer to the texel data and do whatever you want with it).  Then move on to more advanced stuff like moving the camera around, etc.

 

http://www.swiftless.com/opengltuts.html

 

http://www.blitzbasic.com/Community/posts.php?topic=42662


#10r0d

Posted 01 January 2013 - 02:18 PM

Hey there, I've been programming in Java for 2 years and I've recently gotten hold of a NVidia GTX 660. I want to work on my own 3D rendering program but I have no idea how to draw 2D Images to the screen in C++. I know how to do it in Java but C++ looks a little bit more complicated when it comes to making windows. 

I'm using Ubuntu 12.10 64-bit and using NVidia's nvcc compiler which uses gcc and g++.

All I want to do is draw a 2D image to the screen. No GUI, no window borders, just an image.

One idea I had was to set up a socket connection between a C++ app and a Java app which sends the pixel data over my computer to the Java app which displays the image but I think that may be a bit slow (I have no idea).

Is there a way to do this without any external libraries? Can I do this with just the gcc and g++ includes?

Any help is appreciated and I'll give +1 rep for any helpful answers.

 

Wait, do you want to work on a 3D rendering program, or just a 2D one where you directly set each pixel of an image and then just draw that to the screen?

 

I recommend you find some simple OpenGL tutorials online and then start playing around with setting up OGL and drawing some simple shapes to the screen.  Then you can texture them.  (at that point you can get a pointer to the texel data and do whatever you want with it).  Then move on to more advanced stuff like moving the camera around, etc.


PARTNERS