SchneiH2
Members-
Posts
137 -
Joined
-
Last visited
Recent Profile Visitors
3,013 profile views
SchneiH2's Achievements
Newbie (1/14)
4
Reputation
-
Hi everybody Basically, there are two parts of the question: First is that I am trying to translate Ben's Gizmo64 code for the terrian map into a SDK plugin, however so far without success. My below code basically works, however, does not display a terrain texture. I am wondering, how to get the texture id of the terrian, if there is any. int efb_map_draw( XPLMDrawingPhase inPhase, int inIsBefore, void * inRefcon) { XPLMBindTexture2d(map_texture, 1); XPLMSetGraphicsState(0, 1, 0, 1, 1, 0, 0); glColor3f(0.75, 0.75, 0.75); glTranslated(64, 15, 0); glPushMatrix(); glBegin(GL_QUADS); glTexCoord2f(0, 1); glVertex3f(0, 50, 0); glTexCoord2f(0, 0); glVertex3f(0, 230, 0); glTexCoord2f(1, 0); glVertex3f(240, 230, 0); glTexCoord2f(1, 1); glVertex3f(240, 50, 0); glEnd(); glPopMatrix(); return 1; } Secondly, I am wondering whether there is a possibility to display the map from the map UI (i.e. aso differnt layers like VFR, IFR low/high) on an instrument/gauge. At least the G1000 gauge has this option. Having looked through the new map api I could not find any routine to get a texture id of the map. The map sample code on the SDK page creates to my understanding new layers in the map UI bu I do not see there any solution to display the map on an instrument on the 3d panel. Thank you up front for possible help. Best regards SHJ
-
Just to close this topic: Problem solved thanks to Ben's hint to use drawing phase xplm_Phase_Gauges. I just did not use the rght coordinates initially to display the string on the 3d panel. Thansk again for all replies and help. SHJ
-
Hi Jim Thanks for your reply. If I understand correctly than Gizmo64 acts as a kind of overlay to the SDK and uses the SDK code set/API? Using xplm_Phase_Gauges works in a way that it indeed draws the string on the 2D panel. Regarding the Gizmo64 code shown above I am a bit puzzled that to my understanding with glPushMatrix() and glPopMatrix() OpenGL is being addressed. However, adding this to the plugin code does not give any effect. Could there be a necessity to somehow 'load' the 3D panel png in the plugin code? Frankly speaking I do not fully understand the meaning of the second part of below explanantion from the SDK Thanks up front for additional comments Best regards SHJ
-
Hi guys Many thanks to all of you for your responses. Regarding your comments on the advantages of Gizmo64 I fully agree. It is indeed a very handy tool/plugin that allows also people like me with quite basic programming skills to achieve great results. Basically, I could realize almost all functionality I wanted for my a/c with this tool/plugin. However, as the plugin meanwhile became payware and can be obtained according to Ben’s post not on a standalone basis but only together with a X-A payware product it is no longer an option for my project. This because I plan to publish it once it will be ready (god knows when) on a free basis and thus people who want to use it would be forced to buy a X-A payware a/c to get the Gizmo64 plugin to run the freeware a/c they want. Please do not take the aforesaid as any criticism, it is just considering a fact. My project is a pure hobby and I am realistic enough to understand that the result will hardly be on a level that asking money for it can be justified. Therefore, I probably must do it the ‘hard way’ and will see how far I get. At least for the moment I am still more excited than frustrated. Back to the problem itself many thanks to you Ben for the hint with xplm_Phase_Gauges and PhM’s comment. Out of your comments I concluded that I perhaps gave a wrong description of my problem/aim. Basically, I would like to write on the 3D panel (instrument) and not somewhere into the 3D space. After reading your comments and again the SDK docs I suspect that there might be a difference. Please find below as example of the Gizmo64/Lua code I use to display on the EFB (which background is in the 3D panel graphic) the current weather of the destination airport. I just wanted to reproduce this option with the SDK; It might be of course again a good argument for Gizmo64 since a could realize this feature quite easily. function OnDraw_Gauges_3D() if efb_power == 1 and efb_mode ==3 then --EFB wheather gl.PushMatrix() gfx.drawString("AIRPORT ", 1820, 580) gfx.drawString(metar_apt, 1820, 560) gfx.drawString("WHEATHER ",1820, 530) gfx.drawString(metar_data1, 1820, 510) gfx.drawString(metar_data2, 1820, 490) gfx.drawString(metar_data3, 1820, 470) gfx.drawString(metar_data4, 1820, 450) gl.PopMatrix() end end I must admit that I do not know whether Gizmo64 interacts directly with XPlane independently from the SDK structure or if they are linked. In case of the latter I assume that there might be a possibility to do it similarly using the SDK? Whatsoever, many thanks already know for additional comments. Best regards SHJ
-
Hi Can somebody give some help on this topic. I have tried to find as much as possible on the web, however, the information is limited. I have also tested the example http://www.xsquawkbox.net/xpsdk/mediawiki/DrawingHook which works well with my plugin, however, frankly speaking I have a lack of understanding how to continue from this point with the 'string issue'. Although, the following code snippet is probably missing essential parts I include it just to illustrate where am I at the moment with my considerations: XPLMRegisterDrawCallback(My3DTest, xplm_Phase_FirstScene, 0, NULL); XPLMUnregisterDrawCallback(My3DTest, xplm_Phase_LastScene, 0, NULL); int My3DTest( XPLMDrawingPhase inPhase, int inIsBefore, void * inRefcon) { float color[] = { 1.0, 1.0, 1.0 }; glPushMatrix(); XPLMDrawString(color, 300, 120, "Teststring", NULL, xplmFont_Basic); glPopMatrix(); return 1; } If I understand the SDK documentaton correctly then the xplm_Phases should be correct for 3D drawing. Thank you very much for possible help and best regards SHJ
-
Hi Jim Thank you very much for your reply + amended file. Now it works. Was indeed a formatting problem. However, I am still struggeling with this issue. Although, I have set the index for the engines correctly (i.e. 0, 1) and saved the file the second engine shows the value of the first one. This despite the fact that the plugin seems to work correctly, i.e. when checking the dataref values with the DRE everythng is correct. For illustration some pics are attached. I am continuing to check this issues, however, perhaps you have an idea what might be the reason. Thanks and regards SHJ
-
Hi Jim Please find attached the file. Custom dataref is added at the end. Best regards SHJ DataRefs.txt
-
Hi Jim First of all my best wishes to you for 2018. Thank you for your response. The described approach works fine for the part of PM, i.e. when adding the dataref (SSJ100/SD_FUEL/fuel_used float[2] y kgs custom dataref) to the DataRefs.txt the Index-field gets active and can be edited. However, it creates problems with XP11 itself, i.e. leads to a crash when loading any a/c. To avoid any file formating issues I have amended the DataRefs.txt with the normal Windows text editor. Perhaps you have an idea what might be wrong. Thank you and best regards SHJ
-
Hi Just to be sure - I have created in my plugin for the a/c a float array custom dataref (fuel consumption per engine). Everything with the code works well. However, I have noted that when using a CUSTOM array dataref in PlaneMaker the corresponding index field is inactive (please refer to attached pic). Am I doing something wrong? Thanks for possible help and best regards SHJ
-
Hi Ben Thank you very much for your reply and offer. I hope not to disappoint you when saying that I got meanwhile very attracted by this pure programming stuff with the SDK and C++ and will continue this way although I guess that there are a lot of learning lessons ahead to go through. Never thought that I will somewhen start with C++ as it seemd to me very cryptic. Meanwhile, I got at least a first idea about the elegance of this programming language. I am quite optimistic that I will be able to transcribe the basic a/c functions from Gizmo/Lua quite fast, however, will probably get stuck with the 3D graphics stuff which I use for the EFB. Would be great if I could count on some help from you in future. Thank you again for your reply and all the best for 2018! Best regards SHJ
-
Hi PhM Thank your for your reply. There were basically two reasons for the problem (or maybe just one => ucritical copy/paste) The frst one is: XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterDataAccessor(SSJ100_APU_MSw); vs XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterFlightLoopCallback(SSJ100_APU_MSw); WRONG!!! => copy/paste issue The second one was uncorrect use of variable types (int vs float) in the accessor callbacks for the custom datarefs. Thank you again for your feedback and best regards SHJ
-
Hi everybody I am about to transcribe a Gizmo64/Lua script into a plugin. Therefore, I had to start learning C++ where I believe made some good progress on the language itself, however, feel still weak with the whole environment (MS VS2017). So far I was working with the SDK2 and just started to try working with the SDK3. All code I have generated based on the SDK2 works well. including custom datarefs (instruction an examples mainly take from here http://www.xsquawkbox.net/xpsdk/mediawiki/Main_Page. As a basis I took the 'Hello World' example and copied i my code from SDK2. Except for the custom datarefs I can compil the project without errors. When adding the custom datarefs I get a compiler error as shown in the attached picture. Woul be great if somebody could provide some help. Thanks and regards SHJ
-
Hi airfighter Thanks for the confirmation. I have created the rwy/apt from scratch and now it seems to work. I meanwhile have an idea what might have been the reason, however, will have to test it. Once done will let you know. Thanks again and best regards SHJ
-
Hi airfighter Thanks for the reply. If I see it correctly you have tested it under XP10? I am asking because under XP10 I also do not have this problem. Just under XP11. By the way, adding airport bounderies did not help (under XP11) Best regards SHJ