LikeTK's picture

TextureMinFilter in CLI/C++

The following statement does not work in CLI C++

	GL::TexParameterI( TextureTarget::Texture2D,TextureParameterName::TextureMinFilter, (int)TextureMinFilter::Linear);  
	GL::TexParameterI( TextureTarget::Texture2D,TextureParameterName::TextureMagFilter, (int)TextureMagFilter::Linear);
 (int)TextureMinFilter::Linear);  
 (int)TextureMagFilter::Linear);

Both are not recognized as acceptable parameters

Any feedback?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

What is the error message?

Edit (slightly offtopic): you may wish to take a look at glplusplus. It's a raw C++ version of the bindings that can be used along with OpenTK. It's slightly lower level (no implicit GC pins) but should be faster (no interop overhead).

LikeTK's picture

The visual studio intellisense does not recognize

TextureMinFilter::Linear in the first place.

Both TextureParameterName and TextureMinFilter are enum from OpenTK.Graphics.OpenGL

With TextureParameterName :: this will produce a list of option to choose

With TextureMinFilter:: this will not produce a list of option to choose

I will try to use the lastest version and feedback.

Please provide some working example of glplusplus, now, it is not clear what kinds DLLS, that I need to put in the same folder as the test.exe generated from Cmakelist to run the example.

IT is a new standard, but I have not figure out where to read and find more info just to get a quick idea of the values of the glplusplus. More examples will help, ready to run.

Thanks

the Fiddler's picture
Quote:

The visual studio intellisense does not recognize

TextureMinFilter::Linear in the first place.

Does the code compile? You might be hitting a bug in intellisense (which is not as far-fetched as it sounds).

Quote:

Please provide some working example of glplusplus, now, it is not clear what kinds DLLS, that I need to put in the same folder as the test.exe generated from Cmakelist to run the example.

IT is a new standard, but I have not figure out where to read and find more info just to get a quick idea of the values of the glplusplus. More examples will help, ready to run.

Glplusplus is brand new, barely a week old, so examples and documentation are sparse. Check out its readme: the main idea to copy the contents of the include/ and src/ folders into your project, #include "gl++" and then use it just as regular (native) OpenGL.

The test is just a sanity check: does it compile? Does it run? No need to compile it or include it in your project.

More examples will be coming down the road but usage is identical to regular OpenGL. The main difference is that glplusplus formats its functions like OpenTK (i.e. GL::Vertex3 and GL::Ext::GenFramebuffer instead of glVertex3[fdui]v and glGenFramebufferEXT) and that it uses enum parameters instead of const ints.

LikeTK's picture

With TextureParameterName :: this will produce a list of option to choose ( type TextureParameterName :: and the intellisense produce a list of option)

The issue is why
With TextureMinFilter:: this will not produce a list of option to choose

( type TextureMinFilter:: nothing happen,
this means, OpenGL::TextureMinFilter is fine, but not OpenGL::TextureMinFilter::Linear , it is not accepted)

No, the code does not compile, without solving this problem, one can not enable texture in OpenTK CLI/C++.

for most of the time, it is possible to cut and paste codes from C# to CLI/C++. THis is the only exception I found so far. Please advice what I can do to look into the codes to see If I can correct this.

LikeTK's picture

I have replaced the binary with OpenTK 1.1

Not sure this is the main reason, but now intellisense work
Summary:
With TextureMinFilter:: this produce a list of option to choose

Problem: The codes do not compile

GL::TexParameterI( TextureTarget::Texture2D,TextureParameterName::TextureMinFilter, (int)TextureMinFilter::Linear);  
	GL::TexParameterI( TextureTarget::Texture2D,TextureParameterName::TextureMagFilter, (int)TextureMagFilter::Linear);

Error 1 error C2665: 'OpenTK::Graphics::OpenGL::GL::TexParameterI' : none of the 6 overloads could convert all the argument types

LikeTK's picture
	array<int> ^MinFilter = gcnew array<int>(1);
	MinFilter[1] = (int)TextureMinFilter::Linear;
	array<int> ^MagFilter = gcnew array<int>(1);
	MagFilter[1] = (int)TextureMagFilter::Linear;
	GL::TexParameterI( TextureTarget::Texture2D,TextureParameterName::TextureMinFilter, MinFilter);  
	GL::TexParameterI( TextureTarget::Texture2D,TextureParameterName::TextureMagFilter, MagFilter);