Page 2 of 10 FirstFirst 1234 ... LastLast
Results 26 to 50 of 239

Thread: Direct-X Plugin (Beta)

  1. #26
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    doesn't seem to print anything on smart?

    and what it's doing on debug is waiting for RS to load.
    used this to test, if there's somethign wrong with it.

    What is this.. This isn't Smart's console :S That's Simba's debug box.. Smart's console HAS to print something. It doesn't print "Nothing" at all. Even when Smart crashes, it prints something.
    I am Ggzz..
    Hackintosher

  2. #27
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    doesn't seem to print anything on smart?

    and what it's doing on debug is waiting for RS to load.
    In the console that appears!

  3. #28
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    I don't see a console lol


    You sure!?¬!

  4. #29
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Olly View Post


    You sure!?¬!
    ah , thought there was something else that has to pop up.


    Creds to DannyRS for this wonderful sig!

  5. #30
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    ah , thought there was something else that has to pop up.
    Actually NOT sure why your Smart says "d3d9.dll not loaded" and yet it at the same time says: "d3d9.dll has no INIT method".. and it has an Init method:

    Code:
    LIBRARY "d3d9.dll" BASE=0x0000000069640000
    DESCRIPTION "D3D9 Definition File"
    EXPORTS
        D3DPERF_BeginEvent = DXHook_D3DPERF_BeginEvent @1
        D3DPERF_EndEvent = DXHook_D3DPERF_EndEvent @2
        D3DPERF_GetStatus = DXHook_D3DPERF_GetStatus @3
        D3DPERF_QueryRepeatFrame = DXHook_D3DPERF_QueryRepeatFrame @4
        D3DPERF_SetMarker = DXHook_D3DPERF_SetMarker @5
        D3DPERF_SetOptions = DXHook_D3DPERF_SetOptions @6
        D3DPERF_SetRegion = DXHook_D3DPERF_SetRegion @7
        DebugSetLevel = DXHook_DebugSetLevel @8
        DebugSetMute = DXHook_DebugSetMute @9
        Direct3DCreate9 = DXHook_Direct3DCreate9 @10
        Direct3DCreate9Ex = DXHook_Direct3DCreate9Ex @11
        Direct3DShaderValidatorCreate9 = DXHook_Direct3DShaderValidatorCreate9 @12
        PSGPError = DXHook_PSGPError @13
        PSGPSampleTexture = DXHook_PSGPSampleTexture @14
    
        SMARTPluginInit @15

    C++ Code:
    bool SmartDebugEnabled = false;
    bool SmartDirectXEnabled = true;

    void SMARTButtonPressed(int ID, bool State)
    {
        switch(ID)
        {
            case 100:
                if (State)
                {
                    SmartGlobal->setCapture(false);
                    SmartDirectXEnabled = true;
                }
                else
                {
                    SmartGlobal->setCapture(true);
                    SmartDirectXEnabled = false;
                }
                break;

            case 101:
                SmartDebugEnabled = State ? false : true;
                break;

        }
    }

    extern "C" void SMARTPluginInit(SMARTInfo* ptr, bool* ReplaceButtons, int* ButtonCount, char*** ButtonText, int** ButtonIDs, _SMARTButtonPressed* ButtonCallback)
    {
        SmartGlobal = ptr;
        if (ptr)
        {
            *ReplaceButtons = true;
            char** ButtonTexts = new char*[2];
            ButtonTexts[0] = const_cast<char*>("Disable Direct-X_Enable Direct-X");
            ButtonTexts[1] = const_cast<char*>("Enable Debug_Disable Debug");

            int* IDs = new int[2];
            IDs[0] = 100;
            IDs[1] = 101;

            *ButtonCount = 2;
            *ButtonText = ButtonTexts;
            *ButtonIDs = IDs;
            *ButtonCallback = &SMARTButtonPressed;
        }
    }


    Exact same code as in the OpenGL plugin.. It is practically impossible for the plugin NOT to be loading at all.. It exports everything Smart requires with the correct calling convention. In fact, if this plugin fails, so should OpenGL and that means SRL-6 is broken.. But yet that works :S I know I haven't made a mistake in the code; I just copy pasted my Smart headers from the OpenGL project into the DirectX project.

    Another thing is that if the game fails to find an export, it will do: MessageBox(nullptr, e.what(), "ERROR!", 0); which will show which export failed to load.. I don't think you are getting any popups?


    The only thing I can think of is something may be wrong on your end?
    Last edited by Brandon; 01-21-2014 at 01:46 AM.
    I am Ggzz..
    Hackintosher

  6. #31
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Actually NOT sure why your Smart says "d3d9.dll not loaded" and yet it at the same time says: "d3d9.dll has no INIT method".. and it has an Init method:

    Code:
    LIBRARY "d3d9.dll" BASE=0x0000000069640000
    DESCRIPTION "D3D9 Definition File"
    EXPORTS
        D3DPERF_BeginEvent = DXHook_D3DPERF_BeginEvent @1
        D3DPERF_EndEvent = DXHook_D3DPERF_EndEvent @2
        D3DPERF_GetStatus = DXHook_D3DPERF_GetStatus @3
        D3DPERF_QueryRepeatFrame = DXHook_D3DPERF_QueryRepeatFrame @4
        D3DPERF_SetMarker = DXHook_D3DPERF_SetMarker @5
        D3DPERF_SetOptions = DXHook_D3DPERF_SetOptions @6
        D3DPERF_SetRegion = DXHook_D3DPERF_SetRegion @7
        DebugSetLevel = DXHook_DebugSetLevel @8
        DebugSetMute = DXHook_DebugSetMute @9
        Direct3DCreate9 = DXHook_Direct3DCreate9 @10
        Direct3DCreate9Ex = DXHook_Direct3DCreate9Ex @11
        Direct3DShaderValidatorCreate9 = DXHook_Direct3DShaderValidatorCreate9 @12
        PSGPError = DXHook_PSGPError @13
        PSGPSampleTexture = DXHook_PSGPSampleTexture @14
    
        SMARTPluginInit @15

    C++ Code:
    bool SmartDebugEnabled = false;
    bool SmartDirectXEnabled = true;

    void SMARTButtonPressed(int ID, bool State)
    {
        switch(ID)
        {
            case 100:
                if (State)
                {
                    SmartGlobal->setCapture(false);
                    SmartDirectXEnabled = true;
                }
                else
                {
                    SmartGlobal->setCapture(true);
                    SmartDirectXEnabled = false;
                }
                break;

            case 101:
                SmartDebugEnabled = State ? false : true;
                break;

        }
    }

    extern "C" void SMARTPluginInit(SMARTInfo* ptr, bool* ReplaceButtons, int* ButtonCount, char*** ButtonText, int** ButtonIDs, _SMARTButtonPressed* ButtonCallback)
    {
        SmartGlobal = ptr;
        if (ptr)
        {
            *ReplaceButtons = true;
            char** ButtonTexts = new char*[2];
            ButtonTexts[0] = const_cast<char*>("Disable Direct-X_Enable Direct-X");
            ButtonTexts[1] = const_cast<char*>("Enable Debug_Disable Debug");

            int* IDs = new int[2];
            IDs[0] = 100;
            IDs[1] = 101;

            *ButtonCount = 2;
            *ButtonText = ButtonTexts;
            *ButtonIDs = IDs;
            *ButtonCallback = &SMARTButtonPressed;
        }
    }


    Exact same code as in the OpenGL plugin.. It is practically impossible for the plugin NOT to be loading at all.. It exports everything Smart requires with the correct calling convention. In fact, if this plugin fails, so should OpenGL and that means SRL-6 is broken.. But yet that works :S I know I haven't made a mistake in the code; I just copy pasted my Smart headers from the OpenGL project into the DirectX project.

    Another thing is that if the game fails to find an export, it will do: MessageBox(nullptr, e.what(), "ERROR!", 0); which will show which export failed to load.. I don't think you are getting any popups?


    The only thing I can think of is something may be wrong on your end?



    Try this:
    Simba Code:
    {$loadlib libsmartremote}

    var
      params: TStringArray;

    begin
      params := explode(',', between('<iframe id="game" src="', '"', getPage('http://www.runescape.com/game.ws?j=1')));

      if (not fileExists(PluginsPath+'d3d9.dll')) then
      begin
        writeln('NO PLUGIN!@!@@!@');
        terminateScript();
      end;

      smartSpawnClient('C:/Program Files (x86)/Java/jre7/bin/java.exe', stringReplace(PluginPath, '\', '/', [rfReplaceAll]), params[0], ',' + params[1], 800, 600, '', '', '', 'd3d9.dll');
    end.
    I am Ggzz..
    Hackintosher

  7. #32
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    The only thing I can think of is something may be wrong on your end?
    I'm running srl6 on a vm if this matters?


    edit: tried the code, no avail.

    Creds to DannyRS for this wonderful sig!

  8. #33
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    I'm running srl6 on a vm if this matters? edit: tried the code, no avail.
    Weird.. Nothing working? How odd. I ran it in a VM (Hyper-V) worked just fine. Ran it on my comp, it worked just fine as well..

    If it failed, no matter what you should see a popup at least once. Try it on your actual comp? Can you get into DirectX normally without the plugin on your VM? Through the browser or through Smart?
    I am Ggzz..
    Hackintosher

  9. #34
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Weird.. Nothing working? How odd. I ran it in a VM (Hyper-V) worked just fine. Ran it on my comp, it worked just fine as well..

    If it failed, no matter what you should see a popup at least once. Try it on your actual comp? Can you get into DirectX normally without the plugin on your VM? Through the browser or through Smart?
    Yeah I can get on DirectX without a problem on the vm, i'll edit this post. gonna try on comp.

    But I think @Ashaman88; also ran it on his comp(he had the same flickering issue)

    edit: same problem on my comp hmm, what could I be doing wrong?
    Last edited by Sjoe; 01-21-2014 at 02:10 AM.

    Creds to DannyRS for this wonderful sig!

  10. #35
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    Yeah I can get on DirectX without a problem on the vm, i'll edit this post. gonna try on comp.

    But I think @Ashaman88; also ran it on his comp(he had the same flickering issue)

    Don't worry about the flickering.. It only flickers because you told Smart you'd be loading a plugin and Smart thinks you're lying since it isn't seeing any plugins.. Thus it begins to flicker because it isn't capturing any colours and you'll need to disable capturing to stop the flickering. It was designed this way on purpose and it comes in handy to let users know when it is working properly.

    That is what the plugin does.. Well it's the job of the plugin to enable capture..


    Try something else, place the d3d9.dll into C:/Program Files (x86)/Java/jre7/bin then run Smart regularly with no plugins.. Leave "DXI.dll" in C:/Simba/Plugins.. Switch Smart to DirectX mode. This should FORCE load the plugin from the jre7/bin automatically because it has no other choice but to load the first d3d9.dll found..


    Your script should look like this (you should see a popup when Smart loads.. give it a roughly 25 seconds for good measure (in case your comp is slow?).. sometimes the popup is behind smart or on the task bar where "3" is written because it shows 3 smart tabs.. your smart screen should turn black after getting to the login screen! and it will only show colours when you close the popup.. This is a sign that the plugin was indeed loaded and working):
    Last edited by Brandon; 01-21-2014 at 02:20 AM.
    I am Ggzz..
    Hackintosher

  11. #36
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

  12. #37
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Don't worry about the flickering.. It only flickers because you told Smart you'd be loading a plugin and Smart thinks you're lying since it isn't seeing any plugins.. Thus it begins to flicker because it isn't capturing any colours and you'll need to disable capturing to stop the flickering. It was designed this way on purpose and it comes in handy to let users know when it is working properly.

    That is what the plugin does.. Well it's the job of the plugin to enable capture..


    Try something else, place the d3d9.dll into C:/Program Files (x86)/Java/jre7/bin then run Smart regularly with no plugins.. Leave "DXI.dll" in C:/Simba/Plugins.. Switch Smart to DirectX mode. This should FORCE load the plugin from the jre7/bin automatically because it has no other choice but to load the first d3d9.dll found..


    Your script should look like this (you should see a popup when Smart loads.. give it a roughly 25 seconds.. sometimes the popup is behind smart or on the task bar where "3" is written because it shows 3 smart tabs.. your smart screen should turn black after getting to the login screen! and it will only show colours when you close the popup.. This is a sign that the plugin was indeed loaded and working):
    ok, doesn't get black for me (just flickers).

    incase u need to check.

    Creds to DannyRS for this wonderful sig!

  13. #38
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    ok, doesn't get black for me (just flickers).

    incase u need to check.
    It is flickering because you are still telling it to "look for d3d9.dll".. Copy the exact script in my post above (from the image above)..

    Notice the "smartPlugins := []". You are doing it wrong because that screenshot you have here says "Native button 0:101 not found". That means you are still asking Smart to load the plugin instead of forcefully loading it via jre7/bin as described above.
    I am Ggzz..
    Hackintosher

  14. #39
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    It is flickering because you are still telling it to "look for d3d9.dll".. Copy the exact script in my post above (from the image above)..

    Notice the "smartPlugins := []". You are doing it wrong because that screenshot you have here says "Native button 0:101 not found". That means you are still asking Smart to load the plugin instead of forcefully loading it via jre7/bin as described above.
    I used this script to test
    Simba Code:
    program new;
    {$DEFINE SMART}
    {$I srl-6/srl.simba}
    {$loadlib DXI}

    begin
    smartplugins := [];
    SetupSRL;

      if (dxisetup(__smartcurrentpid)) then
        writeln('ok');
    end.
    and I did put the plugin in java bin (and removed it from c:\simba\plugins)

    edit:

    Creds to DannyRS for this wonderful sig!

  15. #40
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    I used this script to test
    Simba Code:
    program new;
    {$DEFINE SMART}
    {$I srl-6/srl.simba}
    {$loadlib DXI}

    begin
    smartplugins := [];
    SetupSRL;

      if (dxisetup(__smartcurrentpid)) then
        writeln('ok');
    end.
    and I did put the plugin in java bin (and removed it from c:\simba\plugins)
    Hmm.. well that's just weird now. Your smart says "I am looking for a plugin's native button and not finding any" even though you're saying that you are not giving it any.. Something is wrong here.. Are you sure you are running "that script" and no other because your smart is saying otherwise and I really cannot figure out where you are going wrong? If you want I can teamviewer you and see why your Smart says that.. Up to you. But if you really are doing everything right, Smart shouldn't be lying like that. @Sjoe;
    Last edited by Brandon; 01-21-2014 at 02:30 AM.
    I am Ggzz..
    Hackintosher

  16. #41
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Hmm.. well that's just weird now. Your smart says "I am looking for a plugin's native button and not finding any" even though you're saying that you are not giving it any.. Something is wrong here.. Are you sure you are running "that script" and no other because your smart is saying otherwise and I really cannot figure out where you are going wrong?
    Yeah it's the only script i'm running

    Creds to DannyRS for this wonderful sig!

  17. #42
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Solved it.. I finally solved it.. Had to make a custom library loader.

    Before I start my long post, please note that you will not and should not try anything mentioned in this particular post as it is intended for me and it is only being posted so I don't forget how to solve it when I finish school tomorrow..

    Here's the thing. Apparently, if you are trying to use Direct-X and your drivers did NOT install d3dx9_43.dll which ships with Microsoft 9.0c User-End Runtime (NOT developer!!), the plugin will try to load d3dx9_43.dll which is NOT on your system..

    This means that no matter what, the plugin will not give an error for this because it simply isn't aware that your system is missing files required to run Direct-X (Especially since I compile with gcc and not MSVC which auto-includes these).. The only way is for me to actually make the plugin try to load this file first.. If it finds it, you're fine, if it doesn't, it will complain. Not sure if I want to do this.. It is however only 1-3 lines of code (just an if statement).

    Anyway, I had to make a loader which was doing:

    C++ Code:
    #include "Platforms.hpp"
    #include <iostream>

    int main()
    {
        if (xLoadLibrary("C:/Simba/Plugins/d3d9.dll"))
        {
            std::cout<<"d3d9.dll loaded just fine!!";
        }

        return 0;
    }

    This is what actually printed the error. It printed "d3dx9_43.dll is missing from your computer........". I was surprised Smart did NOT print this or give any other details other than "failed to load.".. Not only that but Smart actually loads plugins this exact way! Probably the Java side that try-catches it.. Not sure.

    Anyway, for this reason, I will be bundling the plugin WITH d3dx9_43.dll for users who are missing files on their computer (which shouldn't be happening but just in case because I had enough of a hard time solving it today)..

    Note: If it works for you, you don't need it.. otherwise you'll either need to fix your drivers OR if your drivers are fine, then you need to install direct-x 9.0c End-User runtime.. Otherwise you'll need it. It's much easier than installing anything..

    Anyway, good night for now.. I'll see if I can upload the file tomorrow or something (or statically link to d3d9x if a static-lib exists). This is why we have beta testing and need more.. =)


    Note: This post is just for knowledge so I don't forget st00f and so that next time I check here again I'll remember what I have to do.. Please do not install or try anything mentioned in this particular post! It is for me..
    Last edited by Brandon; 01-21-2014 at 04:19 AM.
    I am Ggzz..
    Hackintosher

  18. #43
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    ..

    https://github.com/Brandon-T/DXI/releases/tag/v0.1

    All bugs fixed so far.. Only thing left I guess is to Draw Smart's mouse and do the speed improvements for drawing..
    I am Ggzz..
    Hackintosher

  19. #44
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    https://github.com/Brandon-T/DXI/releases/tag/v0.1

    All bugs fixed so far.. Only thing left I guess is to Draw Smart's mouse and do the speed improvements for drawing..
    flashing with latest plugin

    http://puu.sh/6wTix.png

    I'll follow the steps above this post next

    Edit: updated drivers and still flashing

    Edit2: Downloaded that direct-x 9.0c End-User runtime dealio

    works now!
    Last edited by Ashaman88; 01-24-2014 at 11:54 PM.

  20. #45
    Join Date
    Jul 2012
    Location
    Australia
    Posts
    136
    Mentioned
    0 Post(s)
    Quoted
    57 Post(s)

    Default

    Can't seem to get it to work with anything... The actual Plugin is working and is loading RS in Direct X, but scripts will not do anything. What have I overlooked?

    Unfortunately I cannot use OpenGL at all. The lag is ridiculous when I am using SMART, so this is my only option.

  21. #46
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default


    Quote Originally Posted by Desirousphere View Post
    Can't seem to get it to work with anything... The actual Plugin is working and is loading RS in Direct X, but scripts will not do anything. What have I overlooked?

    Unfortunately I cannot use OpenGL at all. The lag is ridiculous when I am using SMART, so this is my only option.
    Fix you graphics settings. If you got it working an loading then the only problem left is for you to fix your graphic settings in RS.
    I am Ggzz..
    Hackintosher

  22. #47
    Join Date
    Jul 2012
    Location
    Australia
    Posts
    136
    Mentioned
    0 Post(s)
    Quoted
    57 Post(s)

    Default

    Quote Originally Posted by Brandon View Post


    Fix you graphics settings. If you got it working an loading then the only problem left is for you to fix your graphic settings in RS.
    It isn't my graphics. For some reason it'll log in on OpenGL but not Direct X.

  23. #48
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Maybe something is different with the login screens from ogl/direct-x. il look into it.

  24. #49
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Maybe something is different with the login screens from ogl/direct-x. il look into it.
    For me it logged the character in to ingame. But got stuck there

    So wasn't detecting isLoggedIn ingame.

    Creds to DannyRS for this wonderful sig!

  25. #50
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

Page 2 of 10 FirstFirst 1234 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •