• Breaking News

    Can we use a struct variable to initialize another one in HLSL? I'm new to HLSL programming and I want to use a struct variable to init another one, i.e. to use a "copy constructor" in C++. Since struct is customized data structure, I wonder if we can use a "=" to do the copy initialization? e.g. struct MyStruct { int a; float4 n; } MyStruct s1; s1.a = 1; s1.b = float4(1.f); MyStruct s2 = s1; Is the above code usable? https://ift.tt/eA8V8J

    I'm new to HLSL programming and I want to use a struct variable to init another one, i.e. to use a "copy constructor" in C++. Since struct is customized data structure, I wonder if we can use a "=" to do the copy initialization? e.g. struct MyStruct { int a; float4 n; } MyStruct s1; s1.a = 1; s1.b = float4(1.f); MyStruct s2 = s1; Is the above code usable?

    from GameDev.net http://bit.ly/2HXsBSE

    ليست هناك تعليقات

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728