Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualOlof Hedman

Posted 10 October 2012 - 10:53 AM

I think you could also pull this off with some pre-processor magic though


The opengl api requires you to split them before loading, so I don't think the preprocessor will help you?
But maybe just a simple marker in the file you can look for?

[source lang="cpp"]#vertexmain() {..}#fragmentmain() {...}[/source]
Should be simple to write some loader code that finds and split the file on the markers

Edit:
I realized how to do it with preprocessor, should also work Posted Image
Just have a vertex_main and a fragment_main that you patch in a #define for at the top of the file at load.

Interesting concept, might be useful

#2Olof Hedman

Posted 10 October 2012 - 10:52 AM

I think you could also pull this off with some pre-processor magic though


The opengl api requires you to split them before loading, so I don't think the preprocessor will help you?
But maybe just a simple marker in the file you can look for?

[source lang="cpp"]#vertexmain() {..}#fragmentmain() {...}[/source]
Should be simple to write some loader code that finds and split the file on the markers

Edit:
I realized how to do it with preprocessor, should also work :)
Just have a vertex_main and a fragment_main that you patch in a #define for at the top of the file at load.

#1Olof Hedman

Posted 10 October 2012 - 10:48 AM

I think you could also pull this off with some pre-processor magic though


The opengl api requires you to split them before loading, so I don't think the preprocessor will help you?
But maybe just a simple marker in the file you can look for?

[source lang="cpp"]#vertexmain() {..}#fragmentmain() {...}[/source]
Should be simple to write some loader code that finds and split the file on the markers

PARTNERS