• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by VolureDarkAngel · Sep 27, 2013 at 11:00 PM · c++clr

Windows Unity Native Plugin C++/CLR Crash (VMWare)

I am attempting to make a unity plugin for rendering to opengl natively.

I have been able to get a mac version working but bridging c++ to Objective c is simple. I am now attempting to bridge a c++ dll to my C# code and am having little to no luck.

I am able to use every exported method except the rendering methods.

The Header

 extern "C" void __declspec(dllexport) UnitySetGraphicsDevice (void* device, int deviceType, int eventType);
 extern "C" void __declspec(dllexport) UnityRenderEvent (int eventID);


And Code File

 void UnitySetGraphicsDevice (void* device, int deviceType, int eventType){
 }
 
 void UnityRenderEvent (int eventID){
 }





Both of these methods cause unity to crash

However if I omit these two methods, everything else seems to run without a hitch. Since i really need these methods to be functioning, I would like to know what I am doing wrong.

here is an example of a dll export that is working

Header

 void __declspec(dllexport) SetImageParams(void* textureID, int width, int height, const char * pluginsPath, const char * videoURL);

Code

 void SetImageParams(void *textureID, int width, int height, const char * pluginsPath, const char * videoURL){

 }


I am running this in VMWare Fusion on Windows 7

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by VolureDarkAngel · Oct 01, 2013 at 04:08 PM

As it turns out, My Crash had a lot more to do with VMWare than it had to do with unity.

VMWare Fusion handles DirectX 9 however My version of windows 7 already had DirectX 11 installed.

The game would run but the Plugins would not connect to the rendering methods.

I moved over to my old windows XP installation, and everything worked as expected.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

unity can't add reference CLR DLL 0 Answers

Using C++/CLR classes in C# plugins - GetExceptionPointers not implemented exception 0 Answers

Receiving information from a serial port 7 Answers

Unity integration options 1 Answer

Where do methods mocked with [WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall)] end up? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges