Jump to content

  • Log In with Google      Sign In   
  • Create Account

nickme

Member Since 07 Aug 2011
Offline Last Active Aug 22 2016 10:07 AM

Posts I've Made

In Topic: Opengl:why glEnableClientState(GL_TEXTURE_COORD_ARRAY); generate error?

19 August 2016 - 08:03 PM

if I move the errorCheck() one line up, the error was not generated.  why?


In Topic: GLSL:how to pass values to fragment shader.

18 August 2016 - 07:05 PM

For the render to texture comment. Each time you draw one frame your shader is recreating the entire image, this is potentially a lot of work. Once the image is created you don't really need to build it again unless something changes (the location, the scale etc). The idea then is to build it once, store that image and then keep showing the copy each time instead of remaking it. For that you will need to know how to 'Render to texture'. Right now you have been loading textures from jpg files but it's possible to draw onto them just like you draw onto the screen. First you would set your Julia shader, set the 'render target' (the texture to draw on) and then draw the frame. Then your image is stored in the texture. The next time around you just draw that same texture onto the screen instead. You would probably have to follow a tutorial for this as it can be quite confusing.

You mean using glReadPixels()?


In Topic: C++ what is in string after std::istreambuf_iterator< char >(sourceFi...

18 August 2016 - 12:55 PM

Hi Servant of the Lord,

 

thanks for the reply.

 

the stream variable could had been :

                             stream = "\nthis is the 2nd line.\n\nthis is the fifth line.\n\0";

 

that is the data structure that I have to work with. That is what the Opengl shader compiler understand.

 

a little history.  I learned coding began in 1980 by taking a C program in college.  after that I had not done any coding after that until a few years ago i started to code again as a hobby.  And all these times i learned C++ by myself.  so sorry for the Cish coding style.

 

So after using the separate(), how do i print out the whole file?


In Topic: C++ what is in string after std::istreambuf_iterator< char >(sourceFi...

18 August 2016 - 08:46 AM

Using C++-style casts, instead of dangerous C-style casts, would've also helped highlight the problem.  

 

thanks for the reply.

 

can you give me an example of what you would do? 


In Topic: C++ what is in string after std::istreambuf_iterator< char >(sourceFi...

17 August 2016 - 09:37 PM

You seem to keep wanting to break back to C'ish behavior. You'll be much happier if you stick to idiomatic C++ instead. Mixing the two is begging for problems.
 

 

I am only writing this small program to use in my Opengl project.  OpenGL shader are written in C.  hence the C codes.


PARTNERS