# C++ Wrong parameters in void call

## Recommended Posts

for (int i=0; i < 3; i++)
PROJECTION_FORMS[i].Initialize(&grid_size, &FPP_CAM, &grid_shader, Font, &FULLSCR_VBUFF,
&projection_background_color, &projection_grid_color, &projection_line_thickeness,
first_model_object, &wireframe_shader, i, &projection_line_thickeness);//this line seems to be causing problem

where

	void Initialize(float * grid_size_ptr, TSpecCamera * spectator, TShaderObject * gridshader, TGLFont * afont,
unsigned int * afullscrvbuff,
vec3 * abgcol, vec3 * gridcol, float * lthick, TachoGLModel<float> * afirst_model_object, TShaderObject * awireframeshader,
int init_projection, vec3 * awireframe_color)

and where


struct TMainModelEditor : public TGLForm
{
TGLForm * Forms[ max_net_forms ];
TGLForm * actual_visible_form;

TachoGLModel<float> * first_model_object;

TSideProjectionForm PROJECTION_FORMS[3];

float grid_size;
TSpecCamera FPP_CAM;
TGLFont * Font;

unsigned int FULLSCR_VBUFF;
T2DVertex fvbuff[4];

vec3 projection_background_color;
vec3 projection_grid_color;
float projection_line_thickeness;
vec3 projection_wireframe_color;

vec3 selection_color;

};

seems like all pointers are setup good except not

Description    Resource    Path    Location    Type
no matching function for call to 'TSideProjectionForm::Initialize(float*, TSpecCamera*, TShaderObject*, TGLFont*&, unsigned int*, vec3*, vec3*, float*, TachoGLModel<float>*&, TShaderObject*, int&, float*)'    main_framework.h    /WiredNavalBattle/jni/Editor/netforms    line 80    C/C++ Problem

looks like compiler somewhat converts TachoGLModel<float> * to TachoGLModel<float>*&, why is that?

Edited by Cat's machete

##### Share on other sites

Well, I notice you're trying to pass...

float projection_line_thickeness;

... into the last parameter, which seems to expect...

vec3 * awireframe_color

This is partially obscured by the very strange design pattern you seem to be using, of passing a large number of references (normally something only done for in/out parameters, not in-only parameters) into three foreign objects, each of which is expected to initialize... something? Themselves? The objects passed in?

##### Share on other sites

Lol i didnt see that thanks alot, anyway to your confusion, map editor contains, parameters as lets say color of a projection grid since we can project from side/front/top i initialuze 3 windows that need the same params, i dont have then to load shader 3 times but only once in main class, its a part of really bigger story, vcl/windows for android....

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• 9
• 50
• 11
• 17
• 11
• ### Similar Content

• I've been away for a VERY long time, so if this topic has already been discussed, I couldn't find it.
I started using VS2017 recently and I keep getting warnings like this:
1>c:\program files (x86)\microsoft directx sdk (june 2010)\include\d3d10.h(609): warning C4005: 'D3D10_ERROR_FILE_NOT_FOUND': macro redefinition (compiling source file test.cpp) 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\shared\winerror.h(54103): note: see previous definition of 'D3D10_ERROR_FILE_NOT_FOUND' (compiling source file test.cpp) It pops up for various things, but the reasons are all the same. Something is already defined.....
I have DXSDK June2010 and referencing the .lib and .h set correctly (otherwise I wouldn't get this, I'd get errors)
Is there a way to correct this issue or do I just have to live with it?

Also (a little off-topic) the compiler doesn't like to compile my code if I make very small changes.... What's up with that? Can I change it? Google is no help.

• Hi guys,
I am having problems with trying to perform a basic 'shift left' on a char.
char temp[1]; temp[0] = buffer[0] << 1; // buffer[0] is 0xff After this I have temp[0] writing to a file. Instead of being the expected 0x7F it is written as 0xF8.
Any guidance on what I am doing wrong would be awesome.

• Hi all
this is my first post on this forum.
First of all i want to say you that i've searched many posts on this forum about this specific argument, without success, so i write another one....
Im a beginner.
I want use GPU geometry clipmaps algorithm to visualize virtual inifinte terrains.
I already tried to use vertex texture fetch with a single sampler2D with success.

Readed many papers about the argument and all speak about the fact that EVERY level of a geometry clipmap, has its own texture. What means this exactly? i have to
upload on graphic card a sampler2DArray?
With a single sampler2D is conceptually simple. Creating a vbo and ibo on cpu (the vbo contains only the positions on X-Z plane, not the heights)
and upload on GPU the texture containing the elevations. In vertex shader i sample, for every vertex, the relative height to te uv coordinate.
But i can't imagine how can i reproduce various 2d footprint for every level of the clipmap. The only way i can imagine is follow:
Upload the finer texture on GPU (entire heightmap). Create on CPU, and for each level of clipmap, the 2D footprints of entire clipmap.
So in CPU i create all clipmap levels in terms of X-Z plane. In vertex shader sampling these values is simple using vertex texture fetch.
So, how can i to sample a sampler2DArray in vertex shader, instead of upload a sampler2D of entire clipmap?

Sorry for my VERY bad english, i hope i have been clear.

• By mangine
Hello. I am developing a civ 6 clone set in space and I have a few issues. I am using Lua for the logic and UI of the game and c++ directx 12 for the graphics. I need a way to send information between Lua and c++ occasionally and was wondering what is the best and most flexible (and hopefully fast) way to do this. Don't forget that I also need to send things from c++ back to Lua. I know of a lua extension called "LuaBridge" on github but it is a little old and I am worried that it will not work with directx 12. Has anybody done something similar and knows a good method of sending data back and forth? I am aware that Lua is used more and more in the industry and surely plenty of AAA game programmers know the answer to this. I want a good solution that will hopefully still be viable code in a couple of years...
• By owenjr
Hi there.
I'm pretty new to this and I don't know if it has been asked before, but here I go.
I'm developing a game using SFML and C++.
I would like to use the "Tiled" tool to load maps into my game but I don't actually find any tutorial or guide on how to exaclty use it (I know that I have to read an XML file and stuff). I just step into diverse projects that make all a mess.
Anyone knows where can I find good information to make my map loader by myself?